Professional Documents
Culture Documents
Topics in Graphical User Interfaces
Topics in Graphical User Interfaces
Building
Graphical
User
Interfaces
Code Example
Note the use of the “xor” (^)
operator in line 174 – used to merge
or exclude.
• A Linklabel control displays links to other objects such as file or Web pages.
1. The ListBox control allows users to view and to select from multiple
items in a list.
2. ListBoxes are static GUI entities. Users cannot enter new items to the
list.
3. CheckedListBoxes extend ListBoxes by including check boxes next to
each item in the list. This allows for multiple selection.
4. ListBoxes can return multiple items, but not by default.
5. Scrollbars appear if there are more items than can be displayed.
6. The SelectionMode property determines the number of items that can
be selected.
7. The Items property returns all objects in the list as a collection.
8. To add items, used the following:
myListBox.Items.Add(“myListItem”)
ListBoxes
1.A ListView control is similar to a ListBox in that both display lists in which
the user can select one or more items.
2. ListViews can display icons along the items in a list using the ImageList
property.
3. The MultiSelect property is a boolean determines whether multiple items
can be selected.
4. Checkboxes can be included.
5. Code Sample
Tab Control
10. Set the child’s mdiParent property to the parent form, and call the method
Show().
11. The code to create a child usually lies inside an event handler, which
creates a new window in response to a user action. Menu selections
(File->New->Window) are a common way of creating child MDI Parent
windows.
12. Form property MdiChildren is an array of child Form references.
13. Property ActiveMdiChild returns a reference to the active child
window; it returns null if there are no active child windows.
MDI Child
14. Child windows can be minimized, maximized, and closed
independently of each other and of the parent window.
15. Parent and child forms can have different menus, which are merged
wheneve a child window is selected.
a) Property MergeOrder determines the order in which MenuItems
appear when two menus are merged. Lower values appear first. MDI Child
b) For example, if Menu1 has items File,Edit, and Window (and
their orders are 0, 10, and 20) and Menu2 has items Format and
View (and their orders are 7 and 15), then the merged menu
contains items File, Format, Edit, View, and Window.
c) If a parent’s menu has a mergetype that is different from the
child’s mergetype, the child’s menu setting determines the
outcome of the merge. When the child is closed, the parent’s
original menu is restored.
MDI Windows
16. C# provides a mechanism for tracking which child windows are opened in
an MDI container. Property MdiList of class MenuItem determines
whether a MenuItem displays a list of open child windows.
17. MDI containers allow developers to organize the placement of child
windows. The child windows in an MDI application can be arranged by
calling method LayoutMdi of the parent form.
18. LayoutMdi takes a MdiLayout enumeration, which can have values
ArrangeIcons, Cascade, TileHorizontal, and TileVertical.
19. Code Sample
Visual Inheritance