📄 vcdlocate.pas
字号:
unit vcdlocate;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ExtCtrls;
type
TF_locate = class(TForm)
Group_tj: TRadioGroup;
GroupBox1: TGroupBox;
e_tj: TEdit;
b_cx: TBitBtn;
b_exit: TBitBtn;
procedure Group_tjClick(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure b_cxClick(Sender: TObject);
procedure e_tjKeyPress(Sender: TObject; var Key: Char);
procedure b_exitClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
F_locate: TF_locate;
implementation
uses datam, vcdgl;
{$R *.dfm}
procedure TF_locate.Group_tjClick(Sender: TObject);
begin
e_tj.Text:='';
e_tj.SetFocus();
end;
procedure TF_locate.FormClose(Sender: TObject; var Action: TCloseAction);
begin
release;
end;
procedure TF_locate.b_cxClick(Sender: TObject);
var
cxz:string;
begin
if e_tj.Text='' then
begin
Application.MessageBox(PChar('定位条件不能为空,请重新录入!'), PChar('提示'),
MB_ICONEXCLAMATION);
e_tj.SetFocus();
exit;
end;
cxz:=e_tj.Text;
case group_tj.ItemIndex of
0:begin
if not dm.ADO_vcd.Locate('编号',cxz,[]) then
begin
Application.MessageBox(PChar('没有符合条件的记录!'), PChar('提示'),
MB_ICONEXCLAMATION);
e_tj.setfocus();
exit;
end;
end;
1:begin
if not dm.ADO_vcd.Locate('名称',cxz,[]) then
begin
Application.MessageBox(PChar('没有符合条件的记录!'), PChar('提示'),
MB_ICONEXCLAMATION);
e_tj.setfocus();
exit;
end;
end;
2:begin
if not dm.ADO_vcd.Locate('货位号',cxz,[]) then
begin
Application.MessageBox(PChar('没有符合条件的记录!'), PChar('提示'),
MB_ICONEXCLAMATION);
e_tj.setfocus();
exit;
end;
end;
end;
F_vcdgl.DBGrid.Setfocus();
close;
end;
procedure TF_locate.e_tjKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
b_cx.OnClick(b_cx);
end;
end;
procedure TF_locate.b_exitClick(Sender: TObject);
begin
close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -