base_dll.pas

来自「三层ERP系统 (SQL)」· PAS 代码 · 共 67 行

PAS
67
字号
unit Base_Dll;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Base, stdCtrls, DBCtrlsEh, ComCtrls,  DBGridEh, Mask, wwdbedit,
  Wwdotdot, Wwdbcomb;
  
type
  TfrmBase_DLL = class(TfrmBase)
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  protected
    function isEdit():Boolean;    
  public
    { Public declarations }
  end;

var
  frmBase_DLL: TfrmBase_DLL;

implementation

{$R *.dfm}

function TfrmBase_DLL.isEdit: Boolean;
begin
  if (ActiveControl is Tcustomedit) or
    (ActiveControl is Tcustomcombobox) or
    (Activecontrol is TDateTimepicker) or
    (Activecontrol is Tedit) or
    (Activecontrol is TwwDBEdit) or
    (Activecontrol is TwwDBComboBox) or
    (Activecontrol is TdbeditEH) then
    Result:=True
    else
    Result:=False;
end;

procedure TfrmBase_DLL.FormKeyPress(Sender: TObject; var Key: Char);
begin
  inherited;
  if key=#13 then
    begin
      if IsEdit then
        begin
          key:=#0;
          perform(WM_NEXTDLGCTL,0,0);
        end
        else
        begin
          if (activecontrol is TDBGrideh) then
            with tdbgrideh(activecontrol) do
              begin
                if selectedindex<(fieldcount-1) then
                  selectedindex:=selectedindex+1
                  else
                  selectedindex:=0;
              end;
        end;
    end;
end;

end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?