Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the Parent Control from WinForms Designer in Visual Studio?

I am building my user interface in Visual Studio and I've noticed that there is not a set parent property in a control's property toolbar.

I am wondering why this is so, and if there is a clean way to enable this feature. If it's not possible, why isn't it available?

An example of why I need it is that when I'm using a SplitContainer and Panel1 has 10 child panels all with Dock mode set to Fill, it becomes incredibly difficult to add a new panel to the SpitContainer's Panel1.

Visual Studio always assumes that I'm trying to place my new panel as a child of the most-forefront panel already present.

enter image description here

like image 971
atwellpub Avatar asked Feb 22 '12 16:02

atwellpub


People also ask

How do I add different controls to my form?

Add the control by drawingSelect the control by clicking on it. In your form, drag-select a region. The control will be placed to fit the size of the region you selected.


2 Answers

Can you not use the document outline window? link. This will allow you to re-arrange the control hierarchy and child controls.

like image 150
Lukazoid Avatar answered Sep 24 '22 15:09

Lukazoid


this can be access via code, but not in the designer

http://msdn.microsoft.com/en-us/library/system.windows.forms.splitcontainer.aspx

Property is inherited from Control

http://msdn.microsoft.com/en-us/library/system.windows.forms.control.parent.aspx

like image 22
Micah Armantrout Avatar answered Sep 25 '22 15:09

Micah Armantrout