Panel of WinForm

Source: Internet
Author: User

Issues to be aware of when using panel in WinForm:

When several panel sizes are the same, you should be aware of the same position

Is there a problem with overlapping between the panel, in general (when overlapping):

private void Toolstripmenuitem1_click (object sender, EventArgs e)
{
Panel1. Visible = false;
Groupbox1.visible = true;

Panel2. Visible = False


}

private void Toolstripmenuitem2_click (object sender, EventArgs e)
{
Panel1. Visible = true;
Groupbox1.visible = false;
Panel2. Visible = false;


}

private void Toolstripmenuitem3_click (object sender, EventArgs e)
{
Panel2. Visible = true;

Panel1. Visible = false;

Groupbox1.visible = false;
}

That is, as soon as you open the target panel and then close the other, but if you put the panel in the same position and size, you might be able to place the panel that was later placed on the front panel, And when you open Panel2 or Groubox in the back, you close the panel where it was, so it's impossible to see the results you want to see;

That is, you must first identify the panel you want to open before closing the panel.

Such as

private void Toolstripmenuitem1_click (object sender, EventArgs e)
{
Panel1. Visible = false;
Groupbox1.visible = true;

}

private void Toolstripmenuitem2_click (object sender, EventArgs e)
{
Panel1 in groupbox1s so can not close the GroupBox
Panel1. Visible = true;
Groupbox1.visible = false;
Panel2. Visible = false;


}

private void Toolstripmenuitem3_click (object sender, EventArgs e)
{
Panel2 in panel1.so
Panel2. Visible = true;

}

Three panel together

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.