?? spellinputunit.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 + -