InputPw.~pas
上传用户:tj00001
上传日期:2007-01-07
资源大小:672k
文件大小:2k
源码类别:

行业应用

开发平台:

Delphi

  1. //---------------------------------------------------------------------------
  2. //(R)CopyRight KivenSoft International ,inc 1999
  3. //单元名称:口令对话框
  4. //程序名称:电子书库
  5. //作    者:李会文
  6. //开始时间:1998.07.28
  7. //最后修改:1999.06.25
  8. //备注:此单元定义了SRM文件的读写接口
  9. //---------------------------------------------------------------------------
  10. unit InputPw;
  11. interface
  12. uses
  13.   Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  14.   StdCtrls, Buttons, ExtCtrls, KvLabel;
  15. type
  16.   TInPwForm = class(TForm)
  17.     Edit: TEdit;
  18.     CancelSpeedButton: TSpeedButton;
  19.     OkSpeedButton: TSpeedButton;
  20.     Bevel1: TBevel;
  21.     InputLabel: TKvLabel;
  22.     procedure FormKeyPress(Sender: TObject; var Key: Char);
  23.     procedure CancelSpeedButtonClick(Sender: TObject);
  24.     procedure OkSpeedButtonClick(Sender: TObject);
  25.     procedure FormCreate(Sender: TObject);
  26.   private
  27.     { Private declarations }
  28.   public
  29.     { Public declarations }
  30.   end;
  31. var
  32.   InPwForm: TInPwForm;
  33. implementation
  34. {$R *.DFM}
  35. procedure TInPwForm.FormKeyPress(Sender: TObject; var Key: Char);
  36. begin
  37.   if Key=#13 then OkSpeedButtonClick(self);
  38.   if Key=#27 then CancelSpeedButtonClick(self);
  39. end;
  40. procedure TInPwForm.CancelSpeedButtonClick(Sender: TObject);
  41. begin
  42.   Edit.Text:='';
  43.   ModalResult:=mrCancel;
  44. end;
  45. procedure TInPwForm.OkSpeedButtonClick(Sender: TObject);
  46. begin
  47.   ModalResult:=mrOk;
  48. end;
  49. procedure TInPwForm.FormCreate(Sender: TObject);
  50. begin
  51.   CancelSpeedButton.Glyph.LoadFromResourceName(HInstance,'CANCELBMP');
  52.   OkSpeedButton.Glyph.LoadFromResourceName(HInstance,'OKBMP');
  53. end;
  54. end.