![]() ![]() | ||
Windows forms list boxes are based on the Control class, of course, but not directly—instead, they're based directly on the ListControl class, which also is used by other controls, such as checked list boxes. Here's the class hierarchy for the ListBox class:
Object MarshalByRefObject Component Control ListControl ListBox
You can find the more notable public properties of the ListBox class in Table 7.1, the more notable methods in Table 7.2, and the more notable events in Table 7.3, including those members inherited from the ListControl class. Note that as with other Windows controls, I am not listing the notable properties, methods, and events ListBox inherits from the Control class, such as the Click event—you can see all that in Tables 5.1, 5.2, and 5.3 in Chapter 5.
Methods |
Means |
---|---|
BeginUpdate |
Turns off visual updating of the list box until the EndUpdate method is called. |
ClearSelected |
Unselects all the items in a list box. |
EndUpdate |
Resumes visual updating of the list box. |
FindString |
Finds the first item in the list box that begins with the indicated string. |
FindStringExact |
Finds the first item in the list box that matches the indicated string exactly. |
GetItemHeight |
Returns the height of a list box item. |
GetSelected |
Returns True if the indicated item is selected. |
IndexFromPoint |
Returns the index of the item at the given coordinates. |
SetSelected |
Selects or deselects the indicated item in a list box. |
Event |
Means |
---|---|
SelectedIndexChanged |
Occurs when the SelectedIndex property has changed. |
![]() ![]() | ||