splitting the panel in split container dynamically when a new device is connected RRS feed

  • Question

  • I have c# application which runs with USB device. Once an USB device is connected,  it displays a real time reading . There is a provision to connect multiple devices. So when multiple  devices are connected , the split container should split automatically to read the data from the respective devices. Please help me. How to dynamically split and resize the panels.
    Monday, December 16, 2019 6:22 AM

All replies

  • Hi varun_bwazz,
    You can add a new SplitContainer into a container to split the panel.
    Here is a simple code example.

    public Form1()
        splitContainer1.IsSplitterFixed = false;
        SplitContainer splitSnapper = new SplitContainer();
        splitSnapper.Dock = DockStyle.Fill;
        splitSnapper.Parent = splitContainer1.Panel1;

    But SplitContainer has no size property to resize it, you can try to use the TableLayoutPanel control.
    Best Regards,
    Daniel Zhang

    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, December 17, 2019 9:59 AM