⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 base_c.pas

📁 三层ERP系统 (SQL)
💻 PAS
字号:
unit Base_C;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Base, stdCtrls, DBCtrlsEh, ComCtrls,  DBGridEh;

type
  TfrmBase_C = class(TfrmBase)
    procedure FormKeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  protected
    function isEdit():Boolean;virtual;    
  public
    { Public declarations }
  end;

var
  frmBase_C: TfrmBase_C;

implementation

{$R *.dfm}

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

procedure TfrmBase_C.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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -