Search code examples
c#winformsvisual-studio-2010controlspanel

How do I make sure a control is NOT inside a panel?


I have a few panels that take up a lot of space on my form, and sometimes when I drop a new control onto the form, Visual Studios will put that control inside that panel, which is something I do not want. Is there any way to be sure that a control is not inside of a panel?


Solution

  • Use the Document Outline view to see a tree of the hierarchy.

    Click "View" → "Other Windows" → "Document Outline".

    The default shortcut is Ctrl + W, U.

    In addition: Clicking a control in the designer and then clicking multiple times the Esc key will travel up in hierarchy, always selecting the parent, until the root form/control is being selected.

    This could be a way to see visually which control a certain control is contained inside.