Sorts the items in the ListBox.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
forces the collection to add each item back to itself if the Sorted property is true. Each item is then inserted into the correct position.Notes to Inheritors
You can override this method in your derived class to provide your own sorting routine. Access the results of the overridden method by setting the Sorted property to true. When adding items to a ListBox, it is more efficient to sort the items first and then add new items.
The following code example demonstrates using the method. The example demonstrates inheriting from the ListBox class and overriding the method in the derived class to perform a user-defined sort. To run this example paste the following code in an empty form.