mdicontainer与子控件重叠 [英] mdicontainer overlap the childcontrol

查看:90
本文介绍了mdicontainer与子控件重叠的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我有一个带有菜单栏的主页,可以导航到其他表单由于我一直希望将其打开,所以我将其设置为MDICONTAINER.现在,我需要在menustripclick事件中打开一个窗体,因为我设置了该窗体像这样

In my application I have a main page with a menustrip to navigate to other forms Since i want it to be opened always I set it as a MDICONTAINER .now I need to open a form on menustripclick event as child i set the form like this

public partial class MainForm : Form
   {
       public MainForm()
       {

           InitializeComponent();
           this.IsMdiContainer = true;
           loginmain();


           intialsetupform();

       }

       private void companyToolStripMenuItem_Click(object sender, EventArgs e)
       {
           Master.CompanyMasterForm cmpnymasterform = new Master.CompanyMasterForm();
         cmpnymasterform.MdiParent= this ;

           cmpnymasterform.Show();
       }}






一切都很好,我让子窗口正常工作
但是现在我需要在主窗体<<中添加两个面板.一个用于显示状态标记,另一个用于显示其他控件

我已经添加了面板并将其锚定,问题是现在当子窗口打开所有面板时,parentform(mainform)的控件位于子窗口控件上方,这使其变得难以阅读.请提供克服此问题的任何想法






All was Ok and I got the childwindows work correctly
but Now i need to add two panels in the mainform << one for showing status meddages and other for showing some other controls

I had added the panel and anchored them and the issue is that now when the child window opens all the panels and controls of the parentform(mainform) comes above the childwindow controls which make it unreadable Please provide any ideas to overcome this

推荐答案

这里是个主意:谁需要MDI?为什么要折磨自己并吓users用户?
帮自己一个忙:完全不要使用MDI.没有设计,您可以更轻松地实现设计,并且质量更高.即使Microsoft也不鼓励使用MDI,实际上,Microsoft已将其从WPF中删除,并且几乎不支持它.更重要的是,如果您使用MDI,则会吓跑所有用户.只是不要.我可以解释该怎么做.请参阅:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages [在WPF中使用MDI窗口的问题 [ ^ ],
MDIContainer提供错误 [如何在WPF中创建MDI父窗口? [ ^ ],
如何最大程度地设置子表单,最小化最后一个子表单 [ ^ ].

—SA
Here is the idea: who needs MDI, ever? Why torturing yourself and scaring off your users?
Do yourself a great favor: do not use MDI at all. You can do much easier to implement design without it, with much better quality. MDI is highly discouraged even by Microsoft, in fact, Microsoft dropped it out of WPF and will hardly support it. More importantly, you will scare off all your users if you use MDI. Just don''t. I can explain what to do instead. Please see:
http://en.wikipedia.org/wiki/Multiple_document_interface#Disadvantages[^],
Question on using MDI windows in WPF[^],
MDIContainer giving error[^],
How to Create MDI Parent Window in WPF?[^],
How to set child forms maximized, last childform minimized[^].

—SA


请尝试将"TopMost"属性设置为true.
Please try by setting the "TopMost" property to true.


这篇关于mdicontainer与子控件重叠的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆