【delphi开源代码栏目提醒】:以下是网学会员为您推荐的delphi开源代码-JBXX_GYS_CXFORM.pas,希望本篇文章对您学习有所帮助。
unit JBXX_GYS_CXFORM;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, ExtCtrls;
type
TJBXX_GYS_CX = class(TForm)
Label2: TLabel;
Bevel1: TBevel;
Label1: TLabel;
BitBtn1: TBitBtn;
BitBtn2: TBitBtn;
ComboBox1: TComboBox;
Edit1: TEdit;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure BitBtn1Click(Sender: TObject);
procedure ComboBox1KeyPress(Sender: TObject; var Key: Char);
procedure Edit1Enter(Sender: TObject);
procedure Edit1Exit(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure FormShow(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
JBXX_GYS_CX: TJBXX_GYS_CX;
implementation
uses JBXX_GYSFORM;
{$R *.DFM}
procedure TJBXX_GYS_CX.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
animatewindow(handle,300,AW_VER_NEGATIVE+AW_CENTER+AW_HIDE);
end;
procedure TJBXX_GYS_CX.BitBtn1Click(Sender: TObject);
begin
if combobox1.Text='' then begin
messagedlg('请选择
查询项目',mterror,[mbok],0);
combobox1.setfocus;
end else begin
JBXX_GYS.ADOQuery1.filtered:=true;
JBXX_GYS.ADOQuery1.filter:=format(combobox1.text+'='+'''%s''',[edit1.text]);
JBXX_GYS.bitbtn4.caption:='刷 新[&S]';
close;
end;
end;
procedure TJBXX_GYS_CX.ComboBox1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then begin
edit1.setfocus;
end;
end;
procedure TJBXX_GYS_CX.Edit1Enter(Sender: TObject);
begin
tedit(sender).color:=claqua;
end;
procedure TJBXX_GYS_CX.Edit1Exit(Sender: TObject);
begin
tedit(sender).color:=clwindow;
end;
procedure TJBXX_GYS_CX.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then begin
bitbtn1.Click;
end;
end;
procedure TJBXX_GYS_CX.FormShow(Sender: TObject);
begin
combobox1.itemindex:=0;
edit1.text:='';
combobox1.setfocus;
end;
procedure TJBXX_GYS_CX.BitBtn2Click(Sender: TObject);
begin
close;
end;
END.