Reputation: 5644
I'm using different sets of controls on the same location on a form. By default all are visible=false and then certain subsets of the controls are set to visible as the user selects specific values in a combobox dropdown control.
From the user's perspective this works well since they only see the controls that are needed.
However, since the controls occupy the same location on the form it is difficult to manage these in Visual Studio design view.
Is there a way to group sets of these overlapping controls in Visual Studio so that I can select the entire subset of controls quickly and easily? Is there a way to hide certain controls in design view? Right now everything is stacked on top of each other when developing so it makes managing these controls difficult.
Upvotes: 11
Views: 6558
Reputation: 1
This may sound very ordinary but my design practice and philosophy can be summarized as:
For all these reasons I suggest taking advantage of user controls.
Upvotes: 0
Reputation: 1
First of all,
If you work with multiple components in same location, you can use groupboxes in your form. Then, to superimpose these groupboxes, you should edit each of your groupboxes on different place in your form screen. After the edit, you should input size and location data manually in your groupbox properties menu.
If you want to edit one of your groupbox after the set location, you can easily right click any of your groupboxes then click "send to back" and "bring in front" commands. I hope it helps.
Upvotes: -1
Reputation: 942478
A TabControl can do this, works well in design mode. You just need to hide the tabs at runtime. Check my code in this thread.
Upvotes: 5
Reputation: 11644
You can not hide them.
However you can group them in group box and using "Bring to front" and "Send to back" property deal with them.
Upvotes: 0
Reputation: 45109
To get such a beast to work i would put every group into it's own UserControl. On your MainForm you stack all these UserControls above each other.
So at the MainForm you can't really get a good overview, but now you got for every group your individual designer view and in your main form you can hide the complete group by a single line of code userControl.Visible = false
.
Upvotes: 10