我编了一个程序,可是出了一点小问题:
登录时如果用户名输入正确,则没什么问题,如果用户名输入错误的话程序提示“错误”后光标停在“用户名”,但若重新输入,不论正确错误码程序都会全部退出。
登录时如果用户名输入正确,则没什么问题,如果用户名输入错误的话程序提示“错误”后光标停在“用户名”,但若重新输入,不论正确错误码程序都会全部退出。
解决方案 »
- 求C++代码转换!100分
- 100分求有现成的Delphi7示例数据库dbDemos的Access版?
- 2问题:怎样使主板扬声器发声?怎样调出本地连接TCP/IP属性窗口?
- windowsmediaplay 全屏问题
- 这样的数据转化问题怎么解决?
- 自学考试《数据库原理》顺利过关,也爽一爽,散分!:)
- Delphi 绘制界面
- 请问如何在得到treeview中的最后一项?
- 免费提供关于多用户管理的程序,就是程序运行前弹出一窗口要求输入用户名与密码的那种,高手就不用进来了//准程序员
- DBCtrlGrid中我如何根据表中的值决定某字段是否显示?可能有的行显示,有的不显示。
- 好消息!一百分求解几个小问题!答对一题就给分!!绝对假不了!问完就结贴!!如果分不够还可再加!
- 求助:怎么办?
确定后如果输入错误
showmessage('非法用户!');
dl_mma.SetFocus;
xt_dlu.ModalResult := mrNo;
exit;
确定后如果输入正确
if mainform= nil then //如果第一次登录
begin
xt_dlu.Close;
启动程序F7
Application.Initialize;
Application.CreateForm(Txt_dlu, xt_dlu);
Application.CreateForm(TDMykt, DMykt);
Application.CreateForm(Tkq_rykqhz, kq_rykqhz);
Application.CreateForm(TkqModule2, kqModule2);
if xt_dlu = nil then
xt_dlu:=txt_dlu.create(application);
if xt_dlu.ShowModal = mrOK then
begin
Application.CreateForm(TmainForm, mainForm);
mainForm.ShowModal;
Application.Run;
end;
Application.Run;
xt_dlu.ModalResult := mrOk;
end
else //如果重新登录
begin
mainform.visible := true;
xt_dlu.close;
end;
'If the form contains buttons with a ModalResult property set to a value other than mrNone, the form automatically closes when the user clicks one of those buttons and returns the ModalResult value as the return value of ShowModal.'