)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

What is the use of AutoSizeMode in the WinForms MultiSelectionComboBox?

Platform: WinForms |
Control: MultiSelectionComboBox |
Published Date: September 29, 2015 |
Last Revised Date: January 7, 2020

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

 

Note:

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

Samples:

C#: MultiSelectionComboBox_AutoSizeMode_C#

VB: MultiSelectionComboBox_AutoSizeMode_VB

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

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon