📄 useraddunit.~pas
字号:
unit UserAddUnit;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls;
type
TUserAdd = class(TForm)
TabControl: TTabControl;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
UserName: TEdit;
UserPass: TEdit;
UserPass2: TEdit;
UserMemo: TMemo;
btn_OK: TButton;
btn_Cancel: TButton;
procedure btn_OKClick(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
UserAdd: TUserAdd;
implementation
{$R *.dfm}
procedure TUserAdd.btn_OKClick(Sender: TObject);
begin
if UserName.Text='' then
begin
Application.MessageBox('用户不能为空,请重新输入。','错误',MB_OK or MB_ICONEXCLAMATION);
UserName.SetFocus;
Exit;
end;
if UserPass.Text='' then
begin
Application.MessageBox('密码不能为空,请重新输入。','错误',MB_OK or MB_ICONEXCLAMATION);
UserPass.SetFocus;
Exit;
end;
if UserPass.Text<>UserPass2.Text then
begin
Application.MessageBox('密码输入错误,请重新输入。','错误',MB_OK or MB_ICONEXCLAMATION);
UserPass.SetFocus;
Exit;
end;
Close;
ModalResult:=mrOK;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -