Initializes a new instance of the ListBox class.
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
The following code example demonstrates how to create a ListBox control that displays multiple items in columns and can have more than one item selected in the control's list. The code for the example adds 50 items to the ListBox using the Add method of the ListBox.ObjectCollection class and then selects three items from the list using the SetSelected method. The code then displays values from the ListBox.SelectedObjectCollection collection, through the SelectedItems property, and the ListBox.SelectedIndexCollection, through the SelectedIndices property. This example requires that the code is located in and called from a Form.