Presentation is loading. Please wait.

Presentation is loading. Please wait.

ListBoxes The list box control allows the user to view and select from multiple items in a list. CheckedListBox control extends a list box by including.

Similar presentations


Presentation on theme: "ListBoxes The list box control allows the user to view and select from multiple items in a list. CheckedListBox control extends a list box by including."— Presentation transcript:

1 ListBoxes The list box control allows the user to view and select from multiple items in a list. CheckedListBox control extends a list box by including checkboxes next to each item in the list.

2 Common properties Items – list of items within the lsit MultiColumn SelectedIndex – return currently selected item SelectedIndices SelectedItem SelectedItems Sorted – indicates whether items appear in order. True causes alphabetization; default is false

3 Common method GetSelected – takes an index and returns true if the corresponding item is selected. Common event SelectedIndexChanged – generated when selected index changes

4 To add items To add items to the list box or the checkedList box, invoke method Add For example mylistbox->Add(“My item”); To add multiple objects, use Add multiple times or use method AddRange to add an array of objects

5 checkedListBoxes Multiple items can be selected Common properties CheckedItems CheckedIndices CheckOnClick – if true, items can be checked and unchecked with a single mouse click. If false, double click SelectionMode-One

6 Common method GetItemChecked – takes an index, and returns true if corresponding item is checked Common event itemCheck – generated when an item is checked or unchecked ItemCheckEventArgs properties CurrentValue – indicates whether current item is checked or unchecked

7 ComboBoxes Combines TextBox features with a dropdown list It usually appears as a textbox or click the down arrow to its right. By default, the user can enter text into the textbox or click the down arrow to display a list of predefined items

8 Common properties DropDownStyle Simple – text editable; list visuable DropDown- text editable; click to see list DropDownList- text not editable; click to see the list Items –collection of items MaxDropDownItems – maximum items SelectedIndex SelectedItem Sorted Common Event- SelectedIndexChanged


Download ppt "ListBoxes The list box control allows the user to view and select from multiple items in a list. CheckedListBox control extends a list box by including."

Similar presentations


Ads by Google