Unigui : Hide Main Form

来源:互联网 发布:非编软件 编辑:程序博客网 时间:2024/06/15 05:32
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 TUniMainModule, so they are available for all session forms through UniMainModule function (be sure that MainModule is present under "uses" clause of your forms).


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

Regards, 
原创粉丝点击