954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Panels Heap

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! :)

galhajaj
Light Poster
36 posts since May 2011
Reputation Points: 13
Solved Threads: 0
 

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!

ddanbe
Senior Poster
3,829 posts since Oct 2008
Reputation Points: 2,070
Solved Threads: 661
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You
View similar articles that have also been tagged: