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

GetInternalLabelWidth() public static method

Gets the width of the left column.
public static GetInternalLabelWidth ( this propertyGrid ) : int
propertyGrid this The property grid.
return int
        public static int GetInternalLabelWidth(this PropertyGrid propertyGrid)
        {
            //System.Windows.Forms.PropertyGridInternal.PropertyGridView
            object gridView = GetPropertyGridView(propertyGrid);

            //protected int InternalLabelWidth
            PropertyInfo propInfo = gridView.GetType().GetProperty("InternalLabelWidth", BindingFlags.NonPublic | BindingFlags.Instance);
            return (int)propInfo.GetValue(gridView, new object[] {});
        }