📄 unit7.pas
字号:
unit Unit7;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Db, DBTables;
type
TFormConfirm = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
Label2: TLabel;
User: TEdit;
Password: TEdit;
Queryconfirm: TQuery;
procedure FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormConfirm: TFormConfirm;
implementation
uses Unit1, Unit6;
{$R *.DFM}
procedure TFormConfirm.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
tmpsql:string;
begin
if key=VK_ESCAPE then
close;
if key=VK_RETURN then
begin
if (user.Text<>'') and (password.Text<>'') then
begin
with queryconfirm do
begin
tmpsql:='select * from clerkbase where ccode='''+user.text+''' and cpass='''+password.Text+'''';
close;
sql.clear;
sql.add(tmpsql);
prepare;
try
open;
except
messagebox(form1.handle,'数据库连接失败','错误',MB_OK+MB_ICONERROR);
exit;
end;
end;
if not queryconfirm.Eof then
begin
confirm:=true;
clerk:=user.text;
formconfirm.Close;
end;
end
else
begin
key:=0;
postmessage(Handle,WM_NextDlgCTL,0,0);
end;
end;
end;
procedure TFormConfirm.FormShow(Sender: TObject);
begin
confirm:=false;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -