我遇到的问题如下图:
MDI主窗体:MDI子窗体:效果图:
看了图,我想大家能明白我的意思。就是为什么最后的MDI菜单条上会出现两组最小化,还原,关闭的按钮呢?
下面贴上我的代码:
MDI主窗体的代码,很简单,我想不用解释什么了,大家都是好手。using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Linus.Fin.PlugInModel;namespace Linus.Fin.MainFrame
{
public partial class MainForm : Form
{
private AppBridge m_oAppBridge = null;
private ChildForm m_frmChildForm = null;
public MainForm()
{
InitializeComponent(); m_oAppBridge = new AppBridge(this);
m_frmChildForm = new ChildForm(m_oAppBridge.MainInterface);
m_frmChildForm.MdiParent = this;
m_frmChildForm.ControlBox = false;
m_frmChildForm.Show();
} private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
//增加一个新的子窗体
ChildForm frm = new ChildForm(m_oAppBridge.MainInterface);
frm.MdiParent = this;
frm.ControlBox = true;
frm.Text = "Child-" + this.MdiChildren.Length.ToString();
frm.Show(); }
}
}下面是子窗体的代码:using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Linus.Fin.PlugInModel;namespace Linus.Fin.MainFrame
{
public partial class ChildForm : Form
{
private SysFuncList m_ctlFuncList = null;
private MainInterface m_oInterface = null;
public ChildForm(MainInterface oInterface)
{
InitializeComponent();
m_oInterface = oInterface;
//窗体控件,把控件添加到子窗体上,然后这个子窗体将会在主窗体里显示
m_ctlFuncList = new SysFuncList(m_oInterface);
m_ctlFuncList.Dock = DockStyle.Fill;
this.Controls.Add(m_ctlFuncList);
//this.Parent = oInterface.MdiParent;
}
}
}这就是我两个窗体的构造函数,其中MainInterface是项目的插件模型对象,在此可以忽略它的影响。我就是想知道为什么变成上面图示的那样两组按钮,郁闷死我了。
请大家赐予援手。
MDI主窗体:MDI子窗体:效果图:
看了图,我想大家能明白我的意思。就是为什么最后的MDI菜单条上会出现两组最小化,还原,关闭的按钮呢?
下面贴上我的代码:
MDI主窗体的代码,很简单,我想不用解释什么了,大家都是好手。using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Linus.Fin.PlugInModel;namespace Linus.Fin.MainFrame
{
public partial class MainForm : Form
{
private AppBridge m_oAppBridge = null;
private ChildForm m_frmChildForm = null;
public MainForm()
{
InitializeComponent(); m_oAppBridge = new AppBridge(this);
m_frmChildForm = new ChildForm(m_oAppBridge.MainInterface);
m_frmChildForm.MdiParent = this;
m_frmChildForm.ControlBox = false;
m_frmChildForm.Show();
} private void newToolStripMenuItem_Click(object sender, EventArgs e)
{
//增加一个新的子窗体
ChildForm frm = new ChildForm(m_oAppBridge.MainInterface);
frm.MdiParent = this;
frm.ControlBox = true;
frm.Text = "Child-" + this.MdiChildren.Length.ToString();
frm.Show(); }
}
}下面是子窗体的代码:using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Linus.Fin.PlugInModel;namespace Linus.Fin.MainFrame
{
public partial class ChildForm : Form
{
private SysFuncList m_ctlFuncList = null;
private MainInterface m_oInterface = null;
public ChildForm(MainInterface oInterface)
{
InitializeComponent();
m_oInterface = oInterface;
//窗体控件,把控件添加到子窗体上,然后这个子窗体将会在主窗体里显示
m_ctlFuncList = new SysFuncList(m_oInterface);
m_ctlFuncList.Dock = DockStyle.Fill;
this.Controls.Add(m_ctlFuncList);
//this.Parent = oInterface.MdiParent;
}
}
}这就是我两个窗体的构造函数,其中MainInterface是项目的插件模型对象,在此可以忽略它的影响。我就是想知道为什么变成上面图示的那样两组按钮,郁闷死我了。
请大家赐予援手。
http://1853.img.pp.sohu.com.cn/images/2008/9/20/20/26/11d26d5d985g215.jpg
http://1803.img.pp.sohu.com.cn/images/2008/9/20/20/27/11d26d2ae59g213.jpg麻烦达人们再IE里打开一下~~~~
ChildForm frm = new ChildForm(m_oAppBridge.MainInterface);
frm.MdiParent = this;
frm.ShowIcon = false;
//frm.ControlBox = true;
frm.WindowState = FormWindowState.Maximized;
frm.Text = "Child-" + this.MdiChildren.Length.ToString();
frm.Show();