?? findfrm.pas
字號:
{ ********************************************************************** }
{ }
{ DelphiFun 1.0 (Delphi函數查詢器) }
{ FindForm Source }
{ }
{ Copyright (c) 2003 by netrobo & netrobo@sohu.com in changchun }
{ }
{ ********************************************************************** }
unit FindFrm;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxControls, cxContainer, cxEdit, cxTextEdit, cxMaskEdit,
cxDropDownEdit, StdCtrls, cxCheckBox, Buttons,ADODB;
type
TFindForm = class(TForm)
Label1: TLabel;
Label2: TLabel;
cboField: TcxComboBox;
cboValue: TcxComboBox;
ChkLike: TcxCheckBox;
btnFind: TBitBtn;
btnExit: TBitBtn;
procedure cboFieldClick(Sender: TObject);
procedure btnFindClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FindForm: TFindForm;
implementation
uses MainFrm;
{$R *.dfm}
procedure TFindForm.cboFieldClick(Sender: TObject);
var AdoSubQ:TAdoQuery;
begin
cboValue.Properties.Items.Clear;
if cboField.itemindex=1 then begin
AdoSubQ:=TAdoQuery.Create(Self);
AdoSubQ.Connection:=MainForm.AdoConn1;
AdoSubQ.SQL.Add('Select distinct FunCata from FunList');
AdoSubQ.Open;
while not AdoSubQ.Eof do begin
cboValue.Properties.Items.Add(trim(AdoSubQ.fieldbyname('FunCata').AsString));
AdoSubQ.Next;
end;
AdoSubQ.Close;
AdoSubQ.Free;
end;
end;
procedure TFindForm.btnFindClick(Sender: TObject);
var S1,S2:string;
begin
if chkLike.Checked then S2:=' like''%'+cboValue.Text+'%'''
else S2:=' ='''+cboValue.Text+'''';
case cboField.ItemIndex of
0:S1:='FunName';
1:S1:='FunCata';
2:S1:='FunNote';
end;
MainForm.DispFindRec(S1+S2);
end;
procedure TFindForm.FormCreate(Sender: TObject);
begin
cboField.ItemIndex:=0;
end;
procedure TFindForm.FormShow(Sender: TObject);
begin
cboValue.SetFocus;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -