Articles in this section
Category / Section

What is the use of AutoSizeMode in the WinForms MultiSelectionComboBox?

1 min read

AutoSizeMode

The AutoSizeMode helps you to adjust the size of the MultiSelectionComboBox according to your requirement, when its selection mode is set to VisualItem. There are three types of AutoSizeMode.

  1. None.
  2. Vertical.
  3. Horizontal.

 

None - The AutoSizeModes.None allows you to specify the default size of the MultiSelectionComboBox.

 

Vertical - The AutoSizeModes.Vertical allows you to adjust the size with respect to height, based on the items of the MultiSelectionComboBox.

 

Horizontal - The AutoSizeModes.Horizontal allows you to adjust the size with respect to width, based on the items of the MultiSelectionComboBox.

C#

//Sets the AutoSizeMode to None.
this.multiSelectionComboBox1.AutoSizeMode = Syncfusion.Windows.Forms.Tools.AutoSizeModes.None;
//Sets the AutoSizeMode to Vertical.
this.multiSelectionComboBox1.AutoSizeMode = Syncfusion.Windows.Forms.Tools.AutoSizeModes.Vertical;
//Sets the AutoSizeMode to Horizontal.
this.multiSelectionComboBox1.AutoSizeMode = Syncfusion.Windows.Forms.Tools.AutoSizeModes.Horizontal;

VB

'Sets the AutoSizeMode to None.
Me.multiSelectionComboBox1.AutoSizeMode = Syncfusion.Windows.Forms.Tools.AutoSizeModes.None
'Sets the AutoSizeMode to Vertical.
Me.multiSelectionComboBox1.AutoSizeMode = Syncfusion.Windows.Forms.Tools.AutoSizeModes.Vertical
'Sets the AutoSizeMode to Horizontal.
Me.multiSelectionComboBox1.AutoSizeMode = Syncfusion.Windows.Forms.Tools.AutoSizeModes.Horizontal

 

The default value of the AutoSizeMode is Vertical and the DisplayMode should be specified as DisplayMode.VisualItem.

Set the AutoSizeMode as None

Figure 1: MultiSelectionComboBox specified with AutoSizeMode as None

Set the AutoSizeMode as Vertical

Figure 2: MultiSelectionComboBox specified with AutoSizeMode as Vertical

Set the AutoSizeMode as Horizontal

Figure 3: MultiSelectionComboBox specified with AutoSizeMode as Horizontal

Reference link: https://help.syncfusion.com/windowsforms/classic/multiselectioncombobox/automatic-control-sizing

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