写了个Mid窗体把子窗体放到父窗体的Panel中这样就可以
this.IsMdiContainer = true;
SearchCustomer sc = new SearchCustomer();
sc.MdiParent = this;
//sc.Parent = this.panel2;
sc.Show();这样Panel中可以显示出来,但是我为了让Panel每次只出现一个窗体需要从Panel中检索是不是有其他的窗体,网上找资料也没找到,郁闷
而直接在Form中就可以很容易的得到
用
this.MdiChildren
不知道被人有没有遇到过这样的问题
还有没有其他的办法
在线等
this.IsMdiContainer = true;
SearchCustomer sc = new SearchCustomer();
sc.MdiParent = this;
//sc.Parent = this.panel2;
sc.Show();这样Panel中可以显示出来,但是我为了让Panel每次只出现一个窗体需要从Panel中检索是不是有其他的窗体,网上找资料也没找到,郁闷
而直接在Form中就可以很容易的得到
用
this.MdiChildren
不知道被人有没有遇到过这样的问题
还有没有其他的办法
在线等
解决方案 »
- winform datagridview 查询问题?在线
- 谁有Infragistics NetAdvantage for .Net 2008 Vol 1的序列号?
- 强类型dataset的查询条件怎么设置?
- 如何用javascript 得到.net2005控件里的值
- 关于udpClient 收发数据的问题
- 能否帮忙解释一下这些代码。
- c# textbox的内容怎么通过streamwriter实时自动保存到txt文件里
- 求助: C# 使用OleDB读取数据库,读回的顺序与数据库不一致
- 获取某个命名空间下所有的类名
- 花银子买代码,能提供源代码与我联系。 详细要求如下
- 在Web.config文件中写数据库连数据字符串出错?
- 请问帮助文件.chm怎么做啊??
for(int i=0; i< length; i++)
{
if (MdiChidlren[i].Name != 你要的窗体)
MdiChildren[i].Dispose();
}
fareach(Form form in this.MdiChildren)
{
form.close();
}
一样,只能把Form里面的窗体关了,但是Panel里面就关不了(不能得到Panel里面的窗体)
要是没有了这句话
// sc.Parent = this.panel2;
就可以了
把子窗体放到父窗体的Panel中
这样就可以
this.IsMdiContainer = true;
SearchCustomer sc = new SearchCustomer();
sc.MdiParent = this;
sc.Parent = this.panel2;
// 关键有这么一句,窗体就可以在Panel里面了
// 但是也就是这么一句this.MdiChildren就不好使了
sc.Show();
这样Panel中可以显示出来,但是我为了让Panel每次只出现一个窗体需要从Panel中检索是不是有其他的窗体,网上找资料也没找到,郁闷
而直接在Form中就可以很容易的得到
用
this.MdiChildren
不知道被人有没有遇到过这样的问题
还有没有其他的办法
在线等
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
好看啊我在上面还有个ToolBar
直接放在Form里面就不好看了,难道还有其他的办法能有这样的效果?