?? vipcx.pas
字號:
unit vipcx;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
TF_vipcx = class(TForm)
cxGroup: TRadioGroup;
GroupBox1: TGroupBox;
Edit1: TEdit;
b_cx: TBitBtn;
b_exit: TBitBtn;
procedure b_cxClick(Sender: TObject);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
procedure cxGroupClick(Sender: TObject);
procedure b_exitClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_vipcx: TF_vipcx;
implementation
uses datam;
{$R *.dfm}
procedure TF_vipcx.b_cxClick(Sender: TObject);
var
cxz:string;
begin
if edit1.Text='' then
begin
Application.MessageBox(PChar('查詢條件不能為空,請重新錄入!'), PChar('提示'),
MB_ICONEXCLAMATION);
edit1.SetFocus();
exit;
end;
cxz:=edit1.Text;
case cxgroup.ItemIndex of
0:begin
if not dm.ADO_vip.Locate('證號',cxz,[]) then
begin
Application.MessageBox(PChar('沒有符合條件的記錄!'), PChar('提示'),
MB_ICONEXCLAMATION);
edit1.setfocus();
exit;
end;
end;
1:begin
if not dm.ADO_vip.Locate('姓名',cxz,[]) then
begin
Application.MessageBox(PChar('沒有符合條件的記錄!'), PChar('提示'),
MB_ICONEXCLAMATION);
edit1.setfocus();
exit;
end;
end;
2:begin
if not dm.ADO_vip.Locate('電話',cxz,[]) then
begin
Application.MessageBox(PChar('沒有符合條件的記錄!'), PChar('提示'),
MB_ICONEXCLAMATION);
edit1.setfocus();
exit;
end;
end;
3:begin
if not dm.ADO_vip.Locate('地址',cxz,[]) then
begin
Application.MessageBox(PChar('沒有符合條件的記錄!'), PChar('提示'),
MB_ICONEXCLAMATION);
edit1.setfocus();
exit;
end;
end;
end;
close;
end;
procedure TF_vipcx.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if cxgroup.ItemIndex=0 then
if not ( Key in ['0'..'9',#13,#8]) then Key := #0;
if key=#13 then
begin
b_cx.OnClick(b_cx);
end;
end;
procedure TF_vipcx.cxGroupClick(Sender: TObject);
begin
edit1.Text:='';
edit1.SetFocus();
if cxgroup.ItemIndex=0 then
edit1.MaxLength:=5
else
edit1.MaxLength:=0;
end;
procedure TF_vipcx.b_exitClick(Sender: TObject);
begin
close;
end;
procedure TF_vipcx.FormClose(Sender: TObject; var Action: TCloseAction);
begin
release;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -