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

📄 spellinputunit.pas

📁 仓库管理系统 貌似是ACCESS的数据库
💻 PAS
字号:
unit SpellInputUnit;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, DBGrids, StdCtrls, Buttons;

type
  TfrmSpellInput = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    EdtSpell: TEdit;
    BitBtn1: TBitBtn;
    DBGCode: TDBGrid;
    procedure FormShow(Sender: TObject);
    procedure EdtSpellChange(Sender: TObject);
    procedure EdtSpellKeyDown(Sender: TObject; var Key: Word;
      Shift: TShiftState);
    procedure EdtSpellKeyPress(Sender: TObject; var Key: Char);
    procedure BitBtn1Click(Sender: TObject);
  private
    code:string;
    name:string;

  public
    TableName,ColumnName,ColumnID:string;
    procedure showFormData(ATableName,ACoulmnName,ACoulmnID:string;var ACode,AName:string);   //
    {显示窗体,}
  end;

var
  frmSpellInput: TfrmSpellInput;

implementation

uses SpellInputDMCUnit;

{$R *.dfm}

{ TfrmSpellInput }

procedure TfrmSpellInput.showFormData(ATableName,ACoulmnName,ACoulmnID: string; var ACode,
  AName: string);
begin
  frmSpellInput := TfrmSpellInput.Create(Application);
  try
    frmSpellInput.TableName:=ATableName;
    frmSpellInput.ColumnName := ACoulmnName;
    frmSpellInput.ColumnID := ACoulmnID;
    frmSpellInput.ShowModal;
  except
    frmSpellInput.Free;
    frmSpellInput := nil;
  end;
  ACode:=frmSpellInput.Code;
  AName:=frmSpellInput.Name;
end;

procedure TfrmSpellInput.FormShow(Sender: TObject);
begin
  EdtSpell.Text:='';
  EdtSpell.SetFocus;
  SpellInputDM.OfferAllRecord(TableName,ColumnName,ColumnID,EdtSpell.text);//
  DBGCode.DataSource:=SpellInPutDM.DSSpellInput;
  DBGCode.Columns[0].Width:=80;
  DBGCode.Columns[1].Width:=200;
end;

procedure TfrmSpellInput.EdtSpellChange(Sender: TObject);
begin
  SpellInputDM.OfferAllRecord(TableName,ColumnName,ColumnID,EdtSpell.text);
  DBGCode.Columns[0].Width:=80;
  DBGCode.Columns[1].Width:=200;
end;

procedure TfrmSpellInput.EdtSpellKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if key=VK_UP then
    SpellInputDM.MovePoint('up')
  else if key=VK_DOWN then
    SpellInputDM.MovePoint('down');
end;

procedure TfrmSpellInput.EdtSpellKeyPress(Sender: TObject; var Key: Char);
begin
  if key=#13 then
  begin
    bitbtn1click(self);
  end;
end;

procedure TfrmSpellInput.BitBtn1Click(Sender: TObject);
begin
  SpellInputDM.OfferSelectRecord(Code,Name);
  close;
end;

end.

⌨️ 快捷键说明

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