简体   繁体   中英

GroupBox visibility

I've working on an app that displays a restaurant menu and the user has to select which items he wants. I'm using group boxes instead of multiple forms for each of the different categories of food and drink. However some of the group boxes are not becoming visible even after I set their visibility to true. Any help on this issue please?

The main form has the following code:

    private void drinksButton_Click(object sender, EventArgs e)
    {
        drinkGroupBox.Visible = true;
    }

The designer has this code:

    this.userGroupBox.Controls.Add(this.drinksButton);

Try this

private void drinksButton_Click(object sender, EventArgs e)
{
    drinkGroupBox.Visible = true;
    drinkGroupBox.BringToFront();
}

Would be interesting to see where it says

...Controls.Add(this.userGroupBox);

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.

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