Hello! :)
i am starting a new winforms project and i need help in some issue.
i added a panel with radio-buttons and i want to make a several panels with buttons and other components for each radio-button, for when i choose certain radio-button a certain panel will be visible and the others not visible.

i know how to do that.

the problem its complicated to handle it in the designer...
i wanna to setup each panel and make it dissappear for a while for setup another panel in the same place.

one approach is to placing the panels one over another and tell them to change location to the certain place when the program begin - but when i have a lot of panels its a mess...
and there is the thing that when accidently i drag panel over another its contain it...

there is a way to handle this easily? maybe a possibility i do not aware of...

thanks in advance! :)

6 Years
Discussion Span
Last Post by ddanbe

In such situations you better handle it completely programaticaly.
The same situationarrises if you want to handle 100 or more buttons via the designer...
See how 1 Panel is handled in code (designer.cs file etc.) Copy that code and make an array or List of Panels and set all the properties in the code. I place this code right after the InitializeComponent(); method in the constructor of the form. Success!

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.