本文介绍了打开MDI子窗体时如何停用Mdi父窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,
在我的应用程序中,我有一个登录屏幕和一个透明的主菜单屏幕.现在,当我运行应用程序时,将加载mainmenu屏幕,同时还将显示登录屏幕,并在登录屏幕上设置焦点.现在,当激活登录屏幕后,我将尝试停用主菜单,并在有效登录后激活主菜单并关闭登录屏幕.

在有效登录之前,不应激活mainmenu表单.

Hello,
In my application I have a login screen and a main menu screen which is mdiparent. Now when I run application, mainmenu screen get loaded, also at the same time login screen is also displayed and focus is set on login screen. Now when login screen is activated then I am trying to deactivate the main menu and after valid login activate main menu and close the login screen.

The mainmenu form should not be activated till valid login.

How to do this please help??

推荐答案


static void Main()
{
  Application.EnableVisualStyles();
  Application.SetCompatibleTextRenderingDefault(false);

  MyLoginForm login = new MyLoginForm();
  if (login.ShowDialog() == DialogResult.Ok)
  {
    Application.Run(new MainmenuForm());
  }
}



检查有效登录名应该在MyLoginForm中完成,该操作仅应返回OK进行有效登录.



Checking for a valid login should be done in MyLoginForm, which should only return OK for a valid login.



这篇关于打开MDI子窗体时如何停用Mdi父窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 08:42
查看更多