Visual Studio 2010 form designer - groupbox
Is it possible to limit the number of controls in a groupbox in VS 2010. I have a form where many groupboxes are visible or not depe开发者_开发问答nding on the code. That all works as it should. as I have been working on it in design view they are all over the place. Now it is ready to go I want them to be stacked (i.e.so when each groupbox is visible it is in the same plavce as the other controls that are not visible). when I stack them one groupbox becomes a control on the one below. Is there a way that I can make sure that doesn't happen. Any suggestions greatly appreciated
You could keep it separates in design time, and set the position of the visible groupbox in runtime.
Other way could be transform each groupbox in a usercontrol, and load only the one you want to show. I prefer this one because keep the design clean. Put a panel in the place you want to show the groupbox, and work with the control collection of the pannel, clearing or adding user controls (the groupboxes) as needed.
精彩评论