Unigui : Hide Main Form

本文介绍了一种简单的方法来实现应用程序的登录功能。通过将登录窗体设置为应用程序的第一个显示窗体,并在登录成功后隐藏登录窗体并显示主窗体。会话标志和共享信息被放置在MainModule.pas中作为TUniMainModule类的公共成员,以便在整个会话期间的窗体间共享。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

In our application, the login is a mandatory action so we do a simple thing: 

develop a login form, adding the following to be the first form displayed:

initialization
RegisterMainFormClass(TfrmLogin);


and deleting similar lines in the MainForm


If the login succeeds, simply initialize what you need and do:

frmLogin.Hide;
frmMain.Show;


All session flags and shared information, we put them in  MainModule .pas as public members of TUni MainModule , so they are available for all session forms through Uni MainModule  function (be sure that  MainModule  is present under "uses" clause of your forms).


It is very simple, but it works for us...

Regards, 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值