System.Windows.Forms.ListBox.Sorted Property

Gets or sets a value indicating whether the items in the System.Windows.Forms.ListBox are sorted alphabetically.

Syntax

[System.ComponentModel.DefaultValue(false)]
public bool Sorted { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

Use the ListBox.Sorted property to automatically sort strings alphabetically in a System.Windows.Forms.ListBox. As items are added to a sorted System.Windows.Forms.ListBox, the items are moved to the appropriate location in the sorted list. When adding items to a System.Windows.Forms.ListBox, it is more efficient to sort the items first and then add new items.

A System.Windows.Forms.ListBox with its ListBox.Sorted set to true should not be bound to data using the ListControl.DataSource property. To display sorted data in a bound System.Windows.Forms.ListBox, you should bind to a data source that supports sorting and have the data source provide the sorting.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0