Presentation is loading. Please wait.

Presentation is loading. Please wait.

Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the.

Similar presentations


Presentation on theme: "Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the."— Presentation transcript:

1 Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the group box or a panel is moved The main difference between GroupBox and Panel is that group boxes can display a caption and panel can have scrollbars

2 GroupBox properties Controls: controls that the group box contains Text: text displayed on the top portion of the group box (its caption) Panel properties AutoScroll BorderStyle Controls

3 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.

4 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

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

6 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

7 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

8 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

9 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

10 Common properties DropDownStyle  Simple – text editable; list visible  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 "Group Boxes and Panels Arrange components on a GUI Buttons and etc. can be placed inside a group box or panel. All these buttons move together when the."

Similar presentations


Ads by Google