I have a MDI Parent form which contains a panel. 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. How can I show the child form above of all MDI Parent control's. 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).
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.
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;
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.