[英]MDI Child forms overlapped with MDI Parent form controls
I have a MDI Parent form which contains a panel.我有一个包含面板的 MDI 父表单。 The panel includes charts and a some other user information's.
该面板包括图表和其他一些用户信息。 When I open a form from menu, the newly opened form is shown under the MDI parent panel.
当我从菜单打开表单时,新打开的表单显示在 MDI 父面板下。 How can I show the child form above of all MDI Parent control's.
如何在所有 MDI 父控件的上方显示子窗体。 I'm using the below code for opening the form.
我正在使用以下代码打开表单。
SalesInvoice sale = new SalesInvoice();
sale.MdiParent = this;
sale.Show();
First, in your child form properties, in FormBorderStyle property, choose (None).首先,在您的子表单属性中,在 FormBorderStyle 属性中,选择(无)。
Second, replace your code to show your child form to this:其次,替换您的代码以显示您的子表单:
Sale.StartPosition = FormStartPosition.Manual
Sale.Left = 200
Sale.Top = 115
Sale.MdiParent = Me
Sale.Show()
you could change (200) and (115) to your desired directions.您可以将 (200) 和 (115) 更改为您想要的方向。
You can make the form maximize when you show the form.您可以在显示表单时使表单最大化。
Please refer to the following code.请参考以下代码。
private void button1_Click(object sender, EventArgs e)
{
SalesInvoice sale = new SalesInvoice();
sale.MdiParent = this;
sale.Show();
sale.WindowState = FormWindowState.Maximized;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.