⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.pas

📁 delpi数据可例子生产企业人力资源管理系统.rar 生产企业人力资源管理系统.rar
💻 PAS
字号:
unit login;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, SUIForm, jpeg, StdCtrls, SUIButton, SUIEdit;

type
  Tlogin_form = class(TForm)
    login_form: TsuiForm;
    suiEdit1: TsuiEdit;
    suiEdit2: TsuiEdit;
    suiButton1: TsuiButton;
    suiButton2: TsuiButton;
    Label1: TLabel;
    Label2: TLabel;
    Image1: TImage;
    procedure FormCreate(Sender: TObject);
    procedure suiButton1Click(Sender: TObject);
    procedure suiButton2Click(Sender: TObject);
    procedure suiEdit1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  login_form: Tlogin_form;

implementation

{$R *.dfm}

uses datamod, main;

procedure Tlogin_form.FormCreate(Sender: TObject);
begin
  login_form.Caption:='登陆窗口';
end;

procedure Tlogin_form.suiButton1Click(Sender: TObject);
begin
  if trim(suiedit1.Text)='' then
  begin
    suiedit1.SetFocus;
    showmessage('用户名不能为空,请输入正确的用户名!');
    exit;
  end;

  if trim(suiedit2.Text)='' then
  begin
    suiedit2.SetFocus;
    showmessage('密码不能为空,请输入正确的密码!');
    Exit;
  end;

  if trim(suiedit1.Text) <> MyName then
  begin
    suiedit1.SetFocus;
    showmessage('用户名或密码错误!请输入正确的用户名和密码!');
    Exit;
  end;

  if suiedit2.Text <> MyPass then
  begin
    suiedit1.SetFocus;
    showmessage('用户名或密码错误!请输入正确的用户名和密码!');
    Exit;
  end;
  close;
end;

procedure Tlogin_form.suiButton2Click(Sender: TObject);
begin
  if MessageBox(Handle,'你确定真的要退出吗?','信息',MB_YESNO or MB_ICONWARNING)=IDYES then
  begin
    Application.Terminate;
    close;
  end;
end;

procedure Tlogin_form.suiEdit1KeyPress(Sender: TObject; var Key: Char);
begin
  if key = #13 then
    suiButton1Click(Sender);
end;

end.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -