关闭后如何重新显示mdichild [英] how to reshow a mdichild after close

查看:113
本文介绍了关闭后如何重新显示mdichild的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

朋友,

如果我打开MDIChild表单,则该菜单将被禁用.关闭MDIChild表单后,应再次启用菜单.

请帮助我

Hi Friends,

If i open the MDIChild form then the menu will be disable. after i close the MDIChild form the menu should be enable for open again.

Please help me

推荐答案

如果您想禁用/启用菜单,请阅读 ^ ]文章.在那里,您会找到答案.

如何实现呢?内部Menu_OnClick方法:
1)禁用菜单
2)显示第二个表格
内部Form_Closing(Form2)事件
1)启用菜单
If you would like to disable/enable menu, read this[^] article on msdn site. There you''ll find an answer.

How to achieve this? Inside Menu_OnClick method:
1) Disable your menu
2) Show second form
Inside Form_Closing (Form2) event
1) Enable your menu


是的,很简单,
请按照以下步骤操作:
>首先,您需要在程序类中创建主窗体或mdi窗体的静态对象.

>从启动屏幕启动程序时,显示此静态主窗体以初始化其对象.

>现在以这种mdi形式创建菜单,以显示使其成为父形式的子形式.
现在是主要部分...
在子窗体的窗体关闭事件上,禁用MDI窗体的菜单.在这里您将不会创建任何对象,仅引用您在Program类中创建的静态对象.



有关更具体的示例,您还可以参考
^ ]

希望对您有帮助.

-Kshitiz Chandra
www.kshitizchandra.com
Yes its simple,
follow these steps:
> You first need to create a static object of the main form or mdi form in your program class.

> When you start program from Splash screen, show this static main form intializing its object.

> now create menus in this mdi form to show child form making it parent.
Now here comes the main part...
on form closing event of child form disable the menu of the mdi form. Here you will not create any object, just refer to the static object you created in Program class.



for a smiliar example you can also refer
Creating MDI application using C# (Walkthrough)[^]

I hope this helps you.

- Kshitiz Chandra
www.kshitizchandra.com


这篇关于关闭后如何重新显示mdichild的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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