How can I make sure the control is inside the panel?

I have several panels that take up a lot of space in my form, and sometimes when I drop a new control on the form, Visual Studios will install this control inside this panel, which I don’t want. Is there a way to make sure the control is not inside the panel?

+4
source share
3 answers

Use the Document Structure view to see the hierarchy tree.

Click View β†’ Other Windows β†’ Document Structure.

Default shortcut: Ctrl + W , U.

In addition: by clicking a control in the designer, and then clicking several times, the Esc key will move in the hierarchy, always selecting the parent, until the root form / control is selected.

This may be a way to visually control a control inside.

+3
source

Some time has passed since I made winforms, but I believe that the element in the panel will have left and top properties that belong to the starting point of the panel.

If my memory is correct, you can check the location of the control, and it should immediately be clear that they are or are not related to the form itself.

0
source

You can look in the file Form1.Designer.cs and see which container is the parent of the control.

0
source

Source: https://habr.com/ru/post/1334623/


All Articles