Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
35
Set splitter position from code
posted

Hi,

Is it possible to set splitter position dynamically from code? I need to save its last known position and restore it next time application starts...

I' m used to accomplish this by using the SplitPosition property with standard WinForms splitter control...

Setting the Location property: ultraSplitter1.Location = new Point(300, 0); doesn't work for me!

 

Thanks.

  • 18495
    posted

    Hello Realsw,

    To set the position of the splitter in code, you actually set the width or height of the control that the splitter is docked next to.  For example, if you have a treeView docked on the left side of the form and an UltraSplitter docked next to it, you would set the width of the treeView control.

  • 285
    posted

    I'd like to know as well. I also handle the Moving event to block a splitter from moving too far i.e. I need to keep a min size of the docked panel. I'd set the e.SplitY or e.SplitX property in the SplitEventArgs. Can this be done in the SplitterDragging event? Thanks.