Azmyth.Editor.PropertyGridExtensions.MoveSplitterTo C# (CSharp) Method

MoveSplitterTo() public static method

Moves the splitter to the supplied horizontal position.
public static MoveSplitterTo ( this propertyGrid, int xpos ) : void
propertyGrid this The property grid.
xpos int The horizontal position.
return void
        public static void MoveSplitterTo(this PropertyGrid propertyGrid, int xpos)
        {
            //System.Windows.Forms.PropertyGridInternal.PropertyGridView
            object gridView = GetPropertyGridView(propertyGrid);

            //private void MoveSplitterTo(int xpos);
            MethodInfo methodInfo = gridView.GetType().GetMethod("MoveSplitterTo", BindingFlags.NonPublic | BindingFlags.Instance);
            methodInfo.Invoke(gridView, new object[] { xpos });
        }