AndrewRalon
AndrewRalon

Reputation: 524

Delete a SplitContainer without deleting other controls

I can't believe I couldn't find the answer to this....

I no longer need to use a SplitContainer in my WinForms UI. But whenever I delete the SplitContainer, I lose all of my other controls too -- buttons, labels, textboxes, and charts. Anything that was in the SplitContainer is deleted as well. Very annoying.

What is the best way to remove a SplitContainer control but leave everything else in place?

Trivial Example:

enter image description here

Upvotes: 7

Views: 7874

Answers (1)

LarsTech
LarsTech

Reputation: 81610

Make room on your form and drag those controls into the empty space.

Alternatively, go to View - Other Windows - Document Outline and move the child controls out of the SplitContainer's hierarchy.

enter image description here

Do not cut and paste since that will sever your event handlers.

Upvotes: 13

Related Questions