?? base.~pas
字號:
unit Base;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, Mask, DBCtrls;
type
TfrmBase = class(TForm)
procedure FormKeyPress(Sender: TObject; var Key: Char);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
protected
iModuleID: Integer;
sFunctionName: string;
function IsTEdit(): Boolean; virtual;
public
constructor CreateWithFunction(AOwner: TComponent; ModuleID: Integer; FunctionName: string);
{ Public declarations }
end;
var
frmBase: TfrmBase;
implementation
{$R *.dfm}
constructor TfrmBase.CreateWithFunction(AOwner: TComponent; ModuleID: Integer; FunctionName: string);
begin
iModuleID := ModuleID;
sFunctionName := FunctionName;
inherited Create(AOwner);
end;
function TfrmBase.IsTEdit: Boolean; //是否是編輯框
begin
if (ActiveControl is TCustomEdit) or
(ActiveControl is TCustomComboBox) or
(ActiveControl is TDateTimePicker)
then Result := True
else
Result := False;
end;
procedure TfrmBase.FormKeyPress(Sender: TObject; var Key: Char);
begin
//截獲回車鍵,等效于Tab
if key = #13 then
begin
if IsTEdit then
begin
Key := #0;
Perform(WM_NEXTDLGCTL, 0, 0);
end
{else if (ActiveControl is TDBGrid) then
with TDBGrid(ActiveControl) do
if selectedIndex < (FieldCount - 1) then
selectedIndex := selectedIndex + 1
else
selectedIndex := 0;
end;}
end;
end;
procedure TfrmBase.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := cafree;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -