📄 main_passwordform.~pas
字号:
unit main_passwordform;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
StdCtrls, Buttons, DBCtrls, Db, DBTables, Mask, ExtCtrls, jpeg;
type
Tmain_password = class(TForm)
Table1: TTable;
DataSource1: TDataSource;
Panel1: TPanel;
Label1: TLabel;
Label2: TLabel;
Edit1: TEdit;
BitBtn2: TBitBtn;
DBLookupComboBox1: TDBLookupComboBox;
DBEdit1: TDBEdit;
BitBtn1: TBitBtn;
Image1: TImage;
Label3: TLabel;
Label4: TLabel;
Bevel1: TBevel;
Bevel2: TBevel;
procedure FormShow(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure DBLookupComboBox1KeyPress(Sender: TObject; var Key: Char);
procedure Edit1KeyPress(Sender: TObject; var Key: Char);
private
tim:integer;
{ Private declarations }
public
{ Public declarations }
end;
var
main_password: Tmain_password;
implementation
uses mainform;
{$R *.DFM}
procedure Tmain_password.FormShow(Sender: TObject);
begin
tim:=0;
end;
procedure Tmain_password.BitBtn2Click(Sender: TObject);
begin
application.Terminate;
end;
procedure Tmain_password.BitBtn1Click(Sender: TObject);
begin
if dblookupcombobox1.Text='' then
begin
messagebox(main_password.Handle,'请选择用户名!','信息',mb_iconasterisk);
dblookupcombobox1.SetFocus;
end
else
begin
if edit1.Text<>dbedit1.Text then
begin
tim:=tim+1;
if tim<3 then
begin
messagebox(main_password.Handle,'密码输入错误,请重新输入!','信息',mb_iconerror);
edit1.Text:='';
edit1.SetFocus;
end
else
begin
messagebox(main_password.Handle,'密码三次输入错误,请与管理员联系!','信息',mb_iconerror);
application.Terminate;
end;
end
else
begin
main.ShowModal;
close;
end;
end;
end;
procedure Tmain_password.FormClose(Sender: TObject; var Action: TCloseAction);
begin
main.xsjfgl.Enabled:=table1.Fields[2].Value;
main.statusbar1.Panels[1].Text:='长春明日科技有限公司'+' 操作员:'+DBLookupComboBox1.Text ;
main.xsdagl.Enabled:=table1.Fields[3].Value;
main.zgrsgl.Enabled:=table1.Fields[4].Value;
main.sjwh.Enabled:=table1.Fields[5].Value;
main.xtgn.Enabled:=table1.Fields[6].Value;
main.SpeedButton5.Enabled:=table1.Fields[6].Value;
main.SpeedButton29.Enabled:=table1.Fields[6].Value;
main.SpeedButton3.Enabled:=table1.Fields[6].Value;
action:=cafree;
end;
procedure Tmain_password.DBLookupComboBox1KeyPress(Sender: TObject;
var Key: Char);
begin
if key=#13 then
begin
key:=#0;
edit1.SetFocus;
end;
end;
procedure Tmain_password.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
bitbtn1.SetFocus;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -