我刚学delphi我想在主窗体运行之前先通过身份验证,如通过则运行主窗体,如不通过则关闭程序,请那位大大给一完整代码,不要先将主窗体隐藏的方法!谢谢!
解决方案 »
- 新手的数据库问题
- 怎么知道启动应用程序附带的参数
- 如何得到网络不同打印机的列表?如何通过编程的方式设置某台打印机为当前打印机?
- 系统运行时,出现Database login 对话筐如何解决?
- 请旭日升及其他高手进来一下,excel问题
- 帮忙看看[Error] CopyFile.pas(83): '.' expected but '(' found 是什么原因?
- 1.如何列出控制面板中所有的项?2。如何列出系统中所有的输入法?2。如何列出系统中所有安装的软件(类似如:天加删除程序那样?)
- 各位哪有条形码打印的控件和程序源代码下载?谢了!
- 如何通过程序动态设置默认打印机
- 动态生成了一个stringgrid1,要让另一个过程动态生成的stringgrid2具有stringgrid1的属性,怎么办?
- 為什麼高級搜索輸入 dll 查無資料呢?
- 说说组件和类的具体区别
Forms,
Controls,
Unit1 in 'Unit1.pas' {Form1},
Unit2 in 'Unit2.pas' {FrmLogin};begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.CreateForm(TFrmLogin, FrmLogin);
if FrmLogin.ShowModal := mrOk then
Application.Run;
end.
FrmLogin中如果登录成功,写上ModalResult := mrOk;否则写上ModalResult := mrCancel;
Application.Initialize;
FmLogin := TFmLogin.Create(Application);
if FmLogin.ShowModal then //ShowModal被重载,返回true/false,可以直接用 mrOK/mrCancel
begin
FmLogin.Free;
Application.CreateForm(TFmMain, FmMain);
Application.Run;
end
else begin
FmLogin.Free;
end;
if FmLogin.ShowModal=mrOK then 2.你在FrmLogin里面输入用户名密码,点击按钮验证,如果验证通过你返回mrOK
內容是 project MDIApp.exe raised exception class Elnvalidoperation with message 'cannot make a visible window modal'.process stoppded uses step or run to continue
大哥 问题在那里?
Application.Initialize;
FmLogin := TFmLogin.Create(Application);
fmLogin.Visible := False;
if FmLogin.ShowModal = mrOK then //ShowModal被重载,返回true/false,可以直接用 mrOK/mrCancel
begin
FmLogin.Free;
Application.CreateForm(TFmMain, FmMain);
Application.Run;
end
else begin
FmLogin.Free;
end;
老指示 if FmLogin.ShowModal=mrOK then 有错误!
內容是 project MDIApp.exe raised exception class Elnvalidoperation with message 'cannot make a visible window modal'.process stoppded uses step or run to continue
大哥 问题在那里? 难道就没有一人回应吗?
这行加了没有?