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:
The SplitContainer control lets you create complex user interfaces; often, a selection in one panel determines what objects are shown in the other panel. This arrangement is very effective for displaying and browsing information.
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.
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. Do not cut and paste since that will sever your event handlers.
Having two panels allow you to aggregate information in areas, and the bar, or "splitter," makes it easy for users to resize the panels. Introduces the SplitContainer control and describes the commonly used properties, methods, and events. Describes how to control the splitter within the SplitContainer control.
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.
Do not cut and paste since that will sever your event handlers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With