示例#1
0
        public static void AdjustToMaxTextWidth(this CheckedListBox ctrl, int?maxVerticalItems)
        {
            var width = ctrl.GetMaxTextWidth();

            // i add this for the size of the checkbox control in the begining of the item {CheckBoxWidth} + {TextWidth}
            width += SystemInformation.VerticalScrollBarWidth;

            ctrl.Width = ctrl.ColumnWidth = width;            // The control must fit the size of the column
        }