unbindform.pas

来自「家庭理财系统.rar」· PAS 代码 · 共 76 行

PAS
76 行
字号
unit UnbindForm;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TUnbind = class(TForm)
    GroupBox1: TGroupBox;
    Label1: TLabel;
    Cur_user: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Unbind: TUnbind;

implementation

uses LoginForm, DMForm;

{$R *.dfm}

procedure TUnbind.FormCreate(Sender: TObject);
begin
  cur_user.Caption := login.user ;
end;

procedure TUnbind.Button1Click(Sender: TObject);
begin
  with dm.ADOTable1 do
    begin
      Cur_user.Caption := login.user ;
      if (edit1.Text = '') then
        messagebox(getactivewindow(),'请输入密码!','错误!' ,MB_OK + MB_ICONINFORMATION);
      if (edit1.Text <> '') then
        if locate('用户名',cur_user.Caption,[]) then
          if edit1.text<>fields[1].Value then
            messagebox(getactivewindow(),'请重新输入密码!','密码错误!' ,MB_OK + MB_ICONINFORMATION)
          else
            postmessage(handle,wm_close,0,0);
    end;
end;
procedure TUnbind.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
  if key=#13 then
  begin
    with dm.ADOTable1 do
      begin
        Cur_user.Caption := login.user ;
        if (edit1.Text = '') then
          messagebox(getactivewindow(),'请输入密码!','错误!' ,MB_OK + MB_ICONINFORMATION);
        if (edit1.Text <> '') then
          if locate('用户名',cur_user.Caption,[]) then
            if edit1.text<>fields[1].Value then
              messagebox(getactivewindow(),'请重新输入密码!','密码错误!' ,MB_OK + MB_ICONINFORMATION)
            else
              postmessage(handle,wm_close,0,0);
      end;
  end;
end;


end.

⌨️ 快捷键说明

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