1 / 10

Group Boxes and Panels

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

dagmar
Download Presentation

Group Boxes and Panels

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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

More Related