This documentation is archived and is not being maintained.

ComboBox.Sorted Property

Gets or sets a value indicating whether the items in the combo box are sorted.

[Visual Basic]
Public Property Sorted As Boolean
public bool Sorted {get; set;}
public: __property bool get_Sorted();
public: __property void set_Sorted(bool);
public function get Sorted() : Boolean;
public function set Sorted(Boolean);

Property Value

true if the combo box is sorted; otherwise, false. The default is false.


Exception Type Condition
ArgumentException An attempt was made to sort a ComboBox that is attached to a data source.


This property specifies whether the ComboBox sorts exisitng entries and add new entries to the appropriate sorted position in the list. You can use this property to automatically sort items in a ComboBox. As items are added to a sorted ComboBox, the items are moved to the appropriate location in the sorted list. When you set the property to false, new items are added to the end of the existing list. The sort is case-insensitive and in alphabetically ascending order.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ComboBox Class | ComboBox Members | System.Windows.Forms Namespace