关闭mdi后重新打开登录表单(Window应用程序) [英] To Reopen the Login Form after mdi closed(Window Application)

查看:71
本文介绍了关闭mdi后重新打开登录表单(Window应用程序)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尊敬的先生/女士

我有一个登录表格.当用户通过身份验证后,登录表单将被关闭,一个mdi表单将打开.关闭mdiform(或注销)后,必须重新显示我的登录表单,因为它在Skype应用程序中会发生.

我该怎么办?

请帮帮我.

我会热切地等待回应.

谢谢.

Sanjay Gupta

Dear Sir/Mam

i have a login form. As a user get authenticated so that login form should get closed and one mdi form will opens. After closing the mdiform(or logout) my login form must be reappear as it happens in the Skype Application.

How can i do this ?

Please Help me .

i will eagerly waiting for response.

Thanking you.

Sanjay Gupta

推荐答案

在MDI表单上,可以在FormClosingFormClosed事件处理程序中打开登录表单.
On MDI form, you can open the login form in FormClosing or FormClosed event handler.


您可以简单地使用应用程序的ClosingClosed事件,甚至使用ApplicationExit重新启动程序.

在这里查看更多信息:
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.applicationexit.aspx [ ^ ]

祝你好运!
You could simply use the Closing or Closed event or even the ApplicationExit of the Application to restart your program.

Have a look here for more info:
http://msdn.microsoft.com/en-us/library/system.windows.forms.application.applicationexit.aspx[^]

Good luck!


我会在非常接近程序入口点的地方处理这个问题.如果您查看主要功能,则可能会看到以下内容:

I''d handle this very close to the program entry point. If you look in your main function you''ll probably see something like this:

Application.Run(new Form1());



您可以在此处创建一个循环来完成您的工作:



You can create a loop here to do your stuff:

while (condition)
{
    Application.Run(new LoginForm());
    Application.Run(new MainForm());
}



但是您将需要一些额外的逻辑来进行身份验证等.



but you''ll need some extra logic for the authentication etc..


这篇关于关闭mdi后重新打开登录表单(Window应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆