Articles in this section
Category / Section

How to apply font settings in the WinForms MultiColumnComboBox DropDown?

1 min read

Apply font settings

In the MultiColumnComboBox, GridListControl is used as the DropDown control, and its row size is not be applied based on the font settings. GridListControl row and column sizes can be updated based on its font size, by using the ResizeToFit function.

 

The following code example demonstrates the same.

C#

//Resizes the column width on specifying the font.
this.mGrid_02.ColWidths.ResizeToFit(GridRangeInfo.Table());
//Resizes the row height on specifying the font.
this.mGrid_02.RowHeights.ResizeToFit(GridRangeInfo.Table());

VB

'Resizes the column width on specifying the font.
Me.mGrid_02.ColWidths.ResizeToFit(GridRangeInfo.Table())
'Resizes the row height on specifying the font.
Me.mGrid_02.RowHeights.ResizeToFit(GridRangeInfo.Table())

 

Note:

The Grid is displayed without hiding or wrapping text by using the ResizeToFit function in the GridControl.

 

Before selecting font in MultiColumnComboBox

Figure 1: Before selecting font in MultiColumnComboBox

After selecting font in MultiColumnComboBox without resizing rows and columns

Figure 2: After selecting font in MultiColumnComboBox without resizing rows and columns

Font specified in MultiColumnComboBox with resizing rows and columns

Figure 3: Font specified in MultiColumnComboBox with resizing rows and columns

Samples:

C#: MultiColumnComboBox_ResizeToFit_C#

VB: MultiColumnComboBox_ResizeToFit_VB

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied