请教一MDI程序的问题 Dim newfrm As New frmChild newfrm.MdiParent = Me newfrm.Show() 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 C#的frmChild child1 = new frmChild ();child1.MdiParent = this; //必须要设置MdiParent属性child1.Show (); chenjiaxiong(月光宝盒) ,你用的是VB;不过,我没有使用了哦,现在是在C#技术区里面哦不过还是谢谢了quanlm(工兵) ,谢谢了,这样子好像不行哦,没有显示子窗口啊 BaseChild child=new BaseChild();child.Text=menuItem.Text;child.Tag = menuItem.TagNo;child.MdiParent=this;child.WindowState=FormWindowState.Maximized;child.Show(); 参考:private bool IsWindowExisted(string sFormText, string sTagName, int iTagImg) { Form[] charr= this.MdiChildren; //for each child form set the window state to Maximized foreach (Form chform in charr) { if (chform.Name == sFormText) { chform.Activate(); lbTagName.ImageIndex = iTagImg; lbTagName.Text = sTagName; return true; } } return false; }创建子窗体:frmType dataForm = new frmType();if (IsWindowExisted(dataForm.Name, dataForm.sTagName, dataForm.iTagImg)==false) { dataForm.MdiParent = this; dataForm.Show(); lbTagName.ImageIndex = dataForm.iTagImg; lbTagName.Text = dataForm.sTagName; } this.frmMain.MdiParent=true;//frmMain表示主窗体实例frmChild child = new frmChild ();child.MdiParent = this; child1.Show (); 文件下载问题 C# listbox 索引的问题 C# Winform程序:textbox绑定数据的问题。 如何给Form里面的UserControl添加Collection属性? 请教一些关于test case的方法与资料!!! 问题 windows系统与打印相关消息捕捉 为什么会提示文件路径不存在,我用的是OpenOrCreate 看看 index sever问题,救命呀!!! ListBox,使用Details方式显示时,如何能实现:点列标题,就对数据排序呢? 如何遍历树的所有节点? 能否打开多个记录集?
child1.MdiParent = this; //必须要设置MdiParent属性
child1.Show ();
不过还是谢谢了
quanlm(工兵) ,谢谢了,这样子好像不行哦,没有显示子窗口啊
child.Text=menuItem.Text;
child.Tag = menuItem.TagNo;
child.MdiParent=this;
child.WindowState=FormWindowState.Maximized;
child.Show();
private bool IsWindowExisted(string sFormText, string sTagName, int iTagImg)
{
Form[] charr= this.MdiChildren; //for each child form set the window state to Maximized
foreach (Form chform in charr)
{
if (chform.Name == sFormText)
{
chform.Activate();
lbTagName.ImageIndex = iTagImg;
lbTagName.Text = sTagName;
return true;
}
}
return false;
}
创建子窗体:
frmType dataForm = new frmType();
if (IsWindowExisted(dataForm.Name, dataForm.sTagName, dataForm.iTagImg)==false)
{
dataForm.MdiParent = this;
dataForm.Show();
lbTagName.ImageIndex = dataForm.iTagImg;
lbTagName.Text = dataForm.sTagName;
}
frmChild child = new frmChild ();
child.MdiParent = this;
child1.Show ();