wState=wsNormal then
imgSizeButton.Picture.Bitmap :=imgMaxButton.Picture.Bitmap
else if WindowState=wsMaximized then
imgSizeButton.Picture.Bitmap :=imgRestoreButton.Picture.Bitmap
end;
procedure Tfrm_passedit.WMActivate(var Msg: TWMACTIVATE);
begin
if (Msg.Active =WA_ACTIVE) or (Msg.Active =WA_CLICKACTIVE) then
begin
imgCaption.Picture.Bitmap :=imgColorCaption.Picture.Bitmap;
imgLeftUp1.Picture.Bitmap :=imgColorLeftUp.Picture.Bitmap;
imgRightUp1.Picture.Bitmap :=imgColorRightUp.Picture.Bitmap;
coolBarMenu.Bitmap :=imgColorMenubar.Picture.Bitmap;
end
else begin
imgCaption.Picture.Bitmap :=imgGrayCaption.Picture.Bitmap;
imgLeftUp1.Picture.Bitmap :=imgGrayLeftUp.Picture.Bitmap;
imgRightUp1.Picture.Bitmap :=imgGrayRightUp.Picture.Bitmap;
coolBarMenu.Bitmap :=imgGrayMenubar.Picture.Bitmap;
end;
end;
procedure Tfrm_passedit.FormKeyPress(Sender: TObject; var Key: Char);
begin
if key=#13 then
begin
key:=#0;
perform(wm_nextdlgctl,0,0);
end;
end;
procedure Tfrm_passedit.FormActivate(Sender: TObject);
begin
e_oldpass.SetFocus();
end;
procedure Tfrm_passedit.b_okClick(Sender: TObject);
var
kl:variant;
pass:string;
begin
kl:=dm.ado_user.lookup('操作员',zzyname,'口令');
if varisnull(kl) then pass:='' else pass:=kl;
if e_oldpass.text<>pass then
begin
application.messagebox(pchar('原密码录入错,请重新录入!'),pchar('提示')
,MB_ICONEXCLAMATION);
e_oldpass.text:='';
e_oldpass.SetFocus();
exit;
end;
if e_newpass.text<>e_passok.Text then
begin
application.messagebox(pchar('新密码与确认密码不一致,请重新录入!')
,pchar('提示'),0+MB_ICONEXCLAMATION);
e_newpass.text:='';
e_passok.text:='';
e_newpass.SetFocus();
exit;
end;
dm.ado_user.Locate('操作员',zzyname,[]);
dm.ado_user.Edit;
dm.ado_user.FieldByName('口令').asstring:=e_newpass.text;
dm.ado_user.post;
application.messagebox(pchar('密码修改成功!'),pchar('提示')
,MB_ICONINFORMATION);
close;
end;
procedure Tfrm_passedit.b_exitClick(Sender: TObject);
begin
close;
end;
procedure Tfrm_passedit.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
release;
end;