简体   繁体   English

面板和C#中的MDI

[英]panel and MDI in c#

following this link http://www.codeproject.com/KB/cs/MDITabBrowsing.aspx I made MDI and things are working well. 通过此链接http://www.codeproject.com/KB/cs/MDITabBrowsing.aspx,我制作了MDI,并且一切正常。 But I want to use mainform a panel which is splitted. 但是我想使用mainform一个拆分的面板。 In splitted panel 2. I can see my form numbers in tabbar but cann't see my form. 在拆分的面板2中。我可以在标签栏中看到表单编号,但是看不到表单。 It appears under panel. 它出现在面板下。 how can i see it above/ on panel. 我如何在面板上方/上方看到它。 reagrds, 重新思考,

First off, if you're going to ask questions on SO, you need to mark an answer for each one as correct. 首先,如果您要提出关于SO的问题,则需要将每个答案标记为正确。 You've currently asked 11 questions and haven't marked any of them as having a correct answer. 您目前已经问了11个问题,尚未将其中任何一个标记为正确答案。 Users who take the time to answer your questions earn reputation only when their answer is marked as the correct one. 花时间回答您的问题的用户只有在其答案被标记为正确答案时才能赢得声誉。 So please take a moment to do this. 因此,请花一点时间来执行此操作。 You may find your questions falling on deaf ears if you continue to ask without feedback. 如果您继续提问而没有反馈,您可能会发现自己的问题置若de闻。

To mark an answer as correct, pick the one that best helped you, and on the left, under the number of votes the answer received, there is a check-mark. 要将答案标记为正确,请选择对您最有帮助的答案,然后在左侧,在收到答案的票数下方,打勾。 Click on this, and the check-mark will turn green, marking the answer as the accepted one. 单击此按钮,复选标记将变为绿色,将答案标记为已接受。

As for you question: If I understand what you're trying to do, what you want to use is a regular panel. 关于您的问题:如果我了解您要执行的操作,则要使用的是常规面板。 Drop it onto your MDI window surface, and set it to dock left. 将其放到您的MDI窗口表面上,并将其设置为向左停靠。 Make it as wide as you want. 使其尽可能宽。 Now, when you show a child window, it will fill/occupy the space in the right hand side of the MDI window, and will not appear under the panel on the left. 现在,当您显示一个子窗口时,它将填充/占据MDI窗口右侧的空间,并且不会出现在左侧面板下方。

If you want, you can make the panel on the left resizeable as follows: 如果需要,可以使左侧面板的大小可调整,如下所示:

  1. Drop a panel onto the MDI form 将面板放到MDI表单上
  2. Set it to dock left and size it appropriately 将其设置为向左停靠并适当调整大小
  3. Drop a splitter control into the right side of the MDI window (the dark grey background, not on the panel) 将拆分器控件放到MDI窗口的右侧(深灰色背景,不在面板上)
  4. The splitter will appear to the right of the panel, and your MDI windows will dock to the right and be resizeable 拆分器将显示在面板的右侧,并且您的MDI窗口将停靠在右侧并可以调整大小

HTH, HTH,
James 詹姆士

代替SplitContainerControl ,使用Splitter控件。

MDI forms are a parented to the MDI child window. MDI表单是MDI子窗口的父项。 The dark gray background of the MDI parent. MDI父级的深灰色背景。 If you put a panel on the parent, you'll overlap that child window. 如果在父级上放置面板,则该子级窗口会重叠。 And thus overlap the forms as well. 因此,表格也要重叠。

The only fix for this is to set the Dock property of the panel. 唯一的解决方法是设置面板的Dock属性。 Say to the left. 向左说。 That makes the MDI child window resize itself to occupy the remaining space of the parent form. 这使得MDI子窗口调整其自身大小以占据父窗体的剩余空间。 The panel now no longer overlap the MDI forms and they in turn won't overlap the panel. 现在,面板不再与MDI表单重叠,并且它们也不会与面板重叠。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM