当MDI功能包含在容器中时,如何使它起作用? [英] How to let MDI function work when it is included in a container ?
问题描述
我的应用程序中有一个MainForm,并使用
设置MainForm.
There is a MainForm in my application, and set MainForm with
IsMdiContainer=ture
然后在MainForm构造函数中创建几个表单:
And then I create several forms in MainForm constructor :
Form TheForm1 = new Form();
Form TheForm2 = new Form();
Form TheForm3 = new Form();
TheForm1.MdiParent = this;
TheForm2.MdiParent = this;
TheForm3.MdiParent = this;
// and other attributes setting for TheForm1/TheForm2/TheForm3
现在,MDI函数起作用了,我可以单击TheForm1/TheForm2/TheForm3的每个表单,以激活该表单并将其移到MainForm中.
然后,我将一个ToolStripContainer对象
Now, the MDI function works, I can click each form of TheForm1/TheForm2/TheForm3, to activate the form and move it in MainForm.
And then, I draw a toolStripContainer object
toolStripContainer TheContainer = new toolStripContainer()
绘制到MainForm中,还将几个ToolStrips绘制到
into the MainForm, and also draw several ToolStrips into
toolStripContainer1.TopToolStripPanel
中,这样我就可以通过使用系统build_in函数将这些ToolStrip移到任何一个
so that I can move those ToolStrips, by using system built_in function, to any one panel of
TopToolStripPanel/BottomToolStripPanel/LeftToolStripPanel/RightToolStripPanel
面板中toolStripContainer1.
我的问题在下面:
1.我发现我只能做以下几行:
in toolStripContainer1.
My question now are below :
1. I found that I can only do the following lines :
toolStripContaner1.ContentPanel.AddRange(new Control[]{TheForm1, TheForm2, TheForm3});
和TheForm1/TheForm2/TheForm3之间的MDI功能失败!
2.我如何保持TheForm1/TheForm2/TheFom3和MainForm之间的MDI功能,以及如何使toolStripContainer1对象用于mvoe ToolStrips?
and the MDI feature between TheForm1/TheForm2/TheForm3 is fail !
2. How can I keep the MDI feature between TheForm1/TheForm2/TheFom3 and MainForm, and also to have toolStripContainer1 object to mvoe ToolStrips ?
推荐答案
运动,我建议很多时间:不要使用MDI!我解释了原因:
在WPF中使用MDI窗口的问题 [ ^ ],
提供错误的MDIContainer [
Sports, I advised many times: don''t use MDI! I explained why:
Question on using MDI windows in WPF[^],
MDIContainer giving error[^].
Well, some say there is nothing wrong in MDI, even though I''m disagree. Anyway, I would not understand the point. Why having extra trouble when the alternatives (see me references above) are much easier to implement, with much more attractive results?
—SA
这篇关于当MDI功能包含在容器中时,如何使它起作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!