MDI问题请帮忙 [英] MDI Problem please help

查看:84
本文介绍了MDI问题请帮忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在c#gui中创建一个小型MDI项目,我的问题是,每当我单击学生菜单条时,都会创建一个新的学生表格实例,每次这样做时,都会创建一个新的学生表格实例他们的任何方法都将首先关闭父窗体中所有已激活的MDI,然后打开学生窗体,
我正在使用在学生菜单栏上编写的以下代码在运行时创建学生表单的实例

Hello i am creating a small MDI project in c# gui my problem is that whenever i click on the student menu strip a new instance of the student form is created,everytime i do this a new instance of the student form is created is their any method which will first close all the activated MDI in the parent form and then open the student form,
i am creating the instance of the student form at runtime with the help of the following code which i have wrote at the student menu strip

frmstudent studform = new frmstudent();
studform.MdiParent = this;
studform.Show();


请及早答复,我需要这个来完成我的任务...
谢谢你:-\
Radix


please reply early i need this for my assignment...
Thank u :-\
Radix

推荐答案

radix3写道:

是它们的any方法,该方法将首先关闭所有父格式的激活的MDI

is their any method which will first close all the activated MDI in the parent form



不-您必须自己编写-看起来像这样:



No - you have to write it yourself - but it will look like this:

foreach (Form f in MdiChildren)
   {
   f.Close();
   }



然后执行您现有的代码,您就在这里.



Then do your existing code, and you are there.


感谢OriginalGriff确实对我有很大帮助,非常感谢您...

谢谢与问候
基数
Thank u OriginalGriff that really helpd me a lot Thank u very much...

Thanks & Regards
Radix


这篇关于MDI问题请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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