急!!!先有一Delphi信息管理系统,求添加登录窗体方法。。。 有一Delphi信息管理系统,求添加登录窗体方法 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Delphi生成窗体的地方有Login模板 登录界面:unit flongin;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, Buttons, StdCtrls,clusers;type TFrmLongin = class(TForm) GroupBox1: TGroupBox; EdtUser: TEdit; EdtPwd: TEdit; Label1: TLabel; Label2: TLabel; BtnChangePwd: TSpeedButton; BtnCancel: TSpeedButton; BtnOK: TSpeedButton; procedure BtnChangePwdClick(Sender: TObject); procedure BtnOKClick(Sender: TObject); procedure BtnCancelClick(Sender: TObject); procedure EdtPwdKeyPress(Sender: TObject; var Key: Char); private { Private declarations } FSuc : Boolean; public { Public declarations } end;function Longin : Boolean;implementationuses fChangePwd;{$R *.dfm}function Longin : Boolean;begin with TFrmLongin.Create(Application) do try ShowModal; finally Result := FSuc; Free; end;end;procedure TFrmLongin.BtnCancelClick(Sender: TObject);begin FSuc := False; Close;end;工程文件 : Application.Initialize; Application.MainFormOnTaskbar := True; Application.CreateForm(TDM, DM); if Longin then Application.CreateForm(TFrmMain, FrmMain); Application.Run;procedure TFrmLongin.BtnChangePwdClick(Sender: TObject);begin ShowFrmChangePwd(EdtUser.Text,EdtPwd.Text);end;procedure TFrmLongin.BtnOKClick(Sender: TObject);begin if (Trim(EdtUser.Text)='') or (Trim(EdtPwd.Text)='') then begin MessageBox(Handle,'用户名和密码不能空','提示',MB_OK); Exit; end; if TUserAdm.Longin(EdtUser.Text,EdtPwd.Text) then begin FSuc := True; Close; end else begin EdtPwd.Clear; EdtPwd.SetFocus; FSuc := False; MessageBox(Handle,'用户名或密码错误!','提示',MB_OK); end;end;procedure TFrmLongin.EdtPwdKeyPress(Sender: TObject; var Key: Char);begin if Key=#13 then BtnOKClick(nil);end;end. 界面上放了几个TImage,如何让被点击的那个Image看起来与其它几个有所区分? 每日一蛋。。。 哪里有中文版的Delphi下载? Webbrowser控件的問題? 对与Oracle数据库来说是用BDE好还是用ADO好? 采用Midas&Com+开发分步式系统,客户端通过什么方式将数据传输到服务器端? C/S------------->B/S DELPHI6能不能建立MTS?只能建立COM+,注册也是只能注册COM+!怎么办? 程序出错?? 一个小问题:谁能回答? 关于tchart画实时曲线问题 ClientSocket1和 ServerSocket1 不能正常发送和接受信息
unit flongin;interfaceuses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Buttons, StdCtrls,clusers;type
TFrmLongin = class(TForm)
GroupBox1: TGroupBox;
EdtUser: TEdit;
EdtPwd: TEdit;
Label1: TLabel;
Label2: TLabel;
BtnChangePwd: TSpeedButton;
BtnCancel: TSpeedButton;
BtnOK: TSpeedButton;
procedure BtnChangePwdClick(Sender: TObject);
procedure BtnOKClick(Sender: TObject);
procedure BtnCancelClick(Sender: TObject);
procedure EdtPwdKeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
FSuc : Boolean;
public
{ Public declarations }
end;function Longin : Boolean;implementationuses fChangePwd;{$R *.dfm}function Longin : Boolean;
begin
with TFrmLongin.Create(Application) do
try
ShowModal;
finally
Result := FSuc;
Free;
end;
end;procedure TFrmLongin.BtnCancelClick(Sender: TObject);
begin
FSuc := False;
Close;
end;
工程文件 :
Application.Initialize;
Application.MainFormOnTaskbar := True;
Application.CreateForm(TDM, DM);
if Longin then
Application.CreateForm(TFrmMain, FrmMain);
Application.Run;procedure TFrmLongin.BtnChangePwdClick(Sender: TObject);
begin
ShowFrmChangePwd(EdtUser.Text,EdtPwd.Text);
end;procedure TFrmLongin.BtnOKClick(Sender: TObject);
begin
if (Trim(EdtUser.Text)='') or (Trim(EdtPwd.Text)='') then
begin
MessageBox(Handle,'用户名和密码不能空','提示',MB_OK);
Exit;
end;
if TUserAdm.Longin(EdtUser.Text,EdtPwd.Text) then
begin
FSuc := True;
Close;
end
else
begin
EdtPwd.Clear;
EdtPwd.SetFocus;
FSuc := False;
MessageBox(Handle,'用户名或密码错误!','提示',MB_OK);
end;
end;procedure TFrmLongin.EdtPwdKeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then
BtnOKClick(nil);
end;end.