📄 winpass.pas
字号:
unit Winpass;
//****************************************************************
//*公司名:华夏数码有限公司
//*系统名:考勤管理系统
//*程序名:WinPASS
//*
//*--------------------------------------------------------------
//* [年月日] [制造者]
//*--------------------------------------------------------------
//* 2005/11/12 徐二芳
//*
//****************************************************************
interface
uses
System.Drawing, System.Collections, System.ComponentModel,
System.Windows.Forms, System.Data,clsmain,borland.Vcl.SysUtils,dialogs,
System.Resources;
type
TWinpass = class(System.Windows.Forms.Form)
{$REGION 'Designer Managed Code'}
strict private
/// <summary>
/// Required designer variable.
/// </summary>
Components: System.ComponentModel.Container;
GroupBox1: System.Windows.Forms.GroupBox;
Label1: System.Windows.Forms.Label;
Label2: System.Windows.Forms.Label;
Label3: System.Windows.Forms.Label;
Textold: System.Windows.Forms.TextBox;
Textnew: System.Windows.Forms.TextBox;
Textnewer: System.Windows.Forms.TextBox;
Butok: System.Windows.Forms.Button;
Butcancel: System.Windows.Forms.Button;
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure InitializeComponent;
procedure TWinpass_Load(sender: System.Object; e: System.EventArgs);
procedure Butcancel_Click(sender: System.Object; e: System.EventArgs);
procedure Butok_Click(sender: System.Object; e: System.EventArgs);
procedure TWinpass_Closed(sender: System.Object; e: System.EventArgs);
procedure TWinpass_KeyDown(sender: System.Object; e: System.Windows.Forms.KeyEventArgs);
procedure TWinpass_KeyPress(sender: System.Object; e: System.Windows.Forms.KeyPressEventArgs);
{$ENDREGION}
strict protected
/// <summary>
/// Clean up any resources being used.
/// </summary>
procedure Dispose(Disposing: Boolean); override;
private
procedure item_clear();
function item_check():boolean;
function check_textold: boolean;
function check_textnew: boolean;
function check_textnewer: boolean;
function data_upd: boolean;
{ Private Declarations }
public
constructor Create;
end;
[assembly: RuntimeRequiredAttribute(TypeOf(TWinpass))]
implementation
{$REGION 'Windows Form Designer generated code'}
/// <summary>
/// Required method for Designer support -- do not modify
/// the contents of this method with the code editor.
/// </summary>
procedure TWinpass.InitializeComponent;
var
resources: System.Resources.ResourceManager;
begin
resources := System.Resources.ResourceManager.Create(TypeOf(TWinpass));
Self.GroupBox1 := System.Windows.Forms.GroupBox.Create;
Self.Textnewer := System.Windows.Forms.TextBox.Create;
Self.Textnew := System.Windows.Forms.TextBox.Create;
Self.Textold := System.Windows.Forms.TextBox.Create;
Self.Label3 := System.Windows.Forms.Label.Create;
Self.Label2 := System.Windows.Forms.Label.Create;
Self.Label1 := System.Windows.Forms.Label.Create;
Self.Butok := System.Windows.Forms.Button.Create;
Self.Butcancel := System.Windows.Forms.Button.Create;
Self.GroupBox1.SuspendLayout;
Self.SuspendLayout;
//
// GroupBox1
//
Self.GroupBox1.Controls.Add(Self.Textnewer);
Self.GroupBox1.Controls.Add(Self.Textnew);
Self.GroupBox1.Controls.Add(Self.Textold);
Self.GroupBox1.Controls.Add(Self.Label3);
Self.GroupBox1.Controls.Add(Self.Label2);
Self.GroupBox1.Controls.Add(Self.Label1);
Self.GroupBox1.Location := System.Drawing.Point.Create(32, 16);
Self.GroupBox1.Name := 'GroupBox1';
Self.GroupBox1.Size := System.Drawing.Size.Create(232, 184);
Self.GroupBox1.TabIndex := 0;
Self.GroupBox1.TabStop := False;
Self.GroupBox1.Text := ' ';
//
// Textnewer
//
Self.Textnewer.Location := System.Drawing.Point.Create(88, 136);
Self.Textnewer.Name := 'Textnewer';
Self.Textnewer.PasswordChar := '*';
Self.Textnewer.TabIndex := 3;
Self.Textnewer.Text := ' ';
//
// Textnew
//
Self.Textnew.Location := System.Drawing.Point.Create(88, 88);
Self.Textnew.Name := 'Textnew';
Self.Textnew.PasswordChar := '*';
Self.Textnew.TabIndex := 2;
Self.Textnew.Text := ' ';
//
// Textold
//
Self.Textold.Location := System.Drawing.Point.Create(88, 40);
Self.Textold.Name := 'Textold';
Self.Textold.TabIndex := 1;
Self.Textold.Text := ' ';
//
// Label3
//
Self.Label3.Location := System.Drawing.Point.Create(16, 136);
Self.Label3.Name := 'Label3';
Self.Label3.TabIndex := 2;
Self.Label3.Text := ' 确认密码:';
//
// Label2
//
Self.Label2.Location := System.Drawing.Point.Create(16, 88);
Self.Label2.Name := 'Label2';
Self.Label2.TabIndex := 1;
Self.Label2.Text := '新密码:';
//
// Label1
//
Self.Label1.Location := System.Drawing.Point.Create(16, 40);
Self.Label1.Name := 'Label1';
Self.Label1.TabIndex := 0;
Self.Label1.Text := '原密码:';
//
// Butok
//
Self.Butok.Location := System.Drawing.Point.Create(56, 216);
Self.Butok.Name := 'Butok';
Self.Butok.Size := System.Drawing.Size.Create(75, 24);
Self.Butok.TabIndex := 4;
Self.Butok.Text := '确定';
Include(Self.Butok.Click, Self.Butok_Click);
//
// Butcancel
//
Self.Butcancel.Location := System.Drawing.Point.Create(160, 216);
Self.Butcancel.Name := 'Butcancel';
Self.Butcancel.Size := System.Drawing.Size.Create(75, 24);
Self.Butcancel.TabIndex := 5;
Self.Butcancel.Text := '取消';
Include(Self.Butcancel.Click, Self.Butcancel_Click);
//
// TWinpass
//
Self.AutoScaleBaseSize := System.Drawing.Size.Create(6, 14);
Self.ClientSize := System.Drawing.Size.Create(304, 273);
Self.Controls.Add(Self.GroupBox1);
Self.Controls.Add(Self.Butcancel);
Self.Controls.Add(Self.Butok);
Self.Icon := (System.Drawing.Icon(resources.GetObject('$this.Icon')));
Self.KeyPreview := True;
Self.Name := 'TWinpass';
Self.Text := '修改密码';
Include(Self.KeyDown, Self.TWinpass_KeyDown);
Include(Self.KeyPress, Self.TWinpass_KeyPress);
Include(Self.Load, Self.TWinpass_Load);
Include(Self.Closed, Self.TWinpass_Closed);
Self.GroupBox1.ResumeLayout(False);
Self.ResumeLayout(False);
end;
{$ENDREGION}
procedure TWinpass.Dispose(Disposing: Boolean);
begin
if Disposing then
begin
if Components <> nil then
Components.Dispose();
end;
inherited Dispose(Disposing);
end;
constructor TWinpass.Create;
begin
inherited Create;
//
// Required for Windows Form Designer support
//
InitializeComponent;
//
// TODO: Add any constructor code after InitializeComponent call
//
end;
//****************************************************************
//* 窗体加载 [Load]
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinpass.TWinpass_Load(sender: System.Object; e: System.EventArgs);
begin
try
clsmain.winpassshowfla:=true;
item_clear();
except
on ex:exception do
begin
messagebox.Show('TWinpass.twinpass_load:('+ex.message+')','考勤管理系统');
end;
end;
end;
//****************************************************************
//* 窗体卸载 [closed]
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinpass.TWinpass_Closed(sender: System.Object; e: System.EventArgs);
begin
try
clsmain.winpassshowfla:=false;
except
on ex:exception do
begin
messagebox.Show('TWinpass.twinpass_closed:('+ex.message+')','考勤管理系统');
end;
end;
end;
//****************************************************************
//* TWinPass_KeyPress
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinpass.TWinpass_KeyPress(sender: System.Object; e: System.Windows.Forms.KeyPressEventArgs);
begin
try
Case e.KeyChar of
char(13):
begin
e.Handled := False;
SendKeys.Send('{Tab}');
end;
end;
except
on ex:Exception do
begin
messagebox.Show('TWinPass.TWinPass_KeyPress : (' + ex.message + ') ' , '考勤管理系统');
end;
end;
end;
//****************************************************************
//* TWinPass_KeyDown
//*
//* [参数]
//* 1:系统参数
//* 2:系统参数
//* [返回]
//* 无
//****************************************************************
procedure TWinpass.TWinpass_KeyDown(sender: System.Object; e: System.Windows.Forms.KeyEventArgs);
begin
try
Case e.KeyCode of
//--- F7 按下=焦点移动到"确定"按钮
Keys.F7:
begin
e.Handled := False;
self.ButOK.focus();
end;
//--- F9 按下=焦点移动到"取消"按钮
Keys.F9:
begin
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -