Presentation is loading. Please wait.

Presentation is loading. Please wait.

Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010.

Similar presentations


Presentation on theme: "Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010."— Presentation transcript:

1

2 Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010

3 Bina Nusantara University 3 Outline Materi Menus LinkLabels ListBoxes and CheckedListBoxes ComboBoxes TreeViews ListViews Tab Control MDI Windows

4 Bina Nusantara University 4 Menus Menus provide groups of related commands for Windows applications. Menus are an integral part of GUIs, because they organize commands without “cluttering” the GUI.

5 Bina Nusantara University 5 Menus, submenus, and menu items

6 Bina Nusantara University 6 MenuStrip and ToolStripMenuItem properties and an event Description MenuStrip Properties MenuItemsContains the top-level menu items for this MenuStrip. HasChildrenIndicates whether MenuStrip has any child controls (menu items). RIghtToLeftCauses text to display from right to left. This is useful for languages that are read from right to left. ToolStripMenuItem Properties CheckedIndicates whether a menu item is checked. The default value is false, meaning that the menu item is unchecked. CheckOnClickIndicates that a menu item should appear checked or unchecked as it is clicked. IndexSpecifies an item’s position in its parent menu. A value of 0 places the MenuItem at the beginning of the Menu. MenuItemsLists the submenu items for a particular menu item.

7 Bina Nusantara University 7 MenuStrip and ToolStripMenuItem properties and an event Description ShortcutKeyDisplayStringSpecifies text that should appear beside a menu item for a shortcut key. If left blank, the key names are displayed. Otherwise, the text in this property is displayed for the shortcut key. ShortcutKeysSpecifies the shortcut key for the menu item. ShowShortCutKeysIndicates whether a shortcut key is shown beside menu item text. The default is true, which displays the shortcut key. TextSpecifies the menu item’s text. To create an Alt access shortcut, precede a character with &. Common ToolStripMenuITem Event ClickGenerated when an item is clicked or a shortcut key is used. This is the defaulte event when the menu is double-clicked in the designer.

8 Bina Nusantara University 8 LinkLabels The LinkLabel control displays links to other resources, such as files or web pages. A LinkLabel appears as underlined text (colored blue by default). When the mouse moves over the link, the pointer changes to a hand; this is similar to the behavior of a hyperlink in a web page. The link can change color to indicate whether it is not yet visited, previously visited or active.

9 Bina Nusantara University 9 LinkLabels A LinkLabel is the preferred control for indicating that the user can click a link to jump to a resource such as a web page, though other controls can perform similar tasks.

10 Bina Nusantara University 10 LinkLabel properties and an event Description Common Properties ActiveLinkColorSpecifies the color of the active link when clicked. LinkAreaSpecifies which portion of text in the LinkLabel is part of the link. LinkBehaviorSpecifies the link’s behavior, such as how the link appears when the mouse is placed over it. LinkColorSpecifies the original color of all links before they have been visited. The default color is set by the system, and is usually blue. LinkVisitedIf true, the link appears as though it has been visited. TextSpecifies the control’s text. UseMnemonicIf true, the & character in the Text property acts as a shortcut. VisitedLinkColorSpecifies the color of visited links. The default color is set by the system, and is usually purple. Common Event(Event arguments LinkLabelLinkClickedEventArgs) LinkClickedGenerated when the link is clicked. This is the default event when the control is double clicked in Design mode.

11 Bina Nusantara University 11 ListBoxes The ListBox control allows the user to view and select from multiple items in a list. ListBoxes are static GUI entities, which means that users cannot directly edit the list of items. The user can be provided with TextBoxes and Buttons with which to specify items to be added to the list, but the actual additions must be performed in code.

12 Bina Nusantara University 12

13 Bina Nusantara University 13 CheckedListBoxes The CheckedListBox control derives from ListBox and displays a CheckBox with each item. Items can be added via methods Add and AddRange or through the String Collection Editor. CheckedListBoxes allow multiple items to be checked, but item selection is more restrictive.

14 Bina Nusantara University 14

15 Bina Nusantara University 15 ComboBoxes The CombBox control combines TextBox features with a drop-down list-a GUI component that contains a list from which a value can be selected. A ComboBox usually appears as a TextBox with a down arrow to its right. By default, the user can enter text into the TextBox or click the down narrow to display a list of predefined items. If a user chooses an element from this list, that element is displayed in the TextBox.

16 Bina Nusantara University 16

17 Bina Nusantara University 17 TreeViews The TreeView control displays nodes hierarchically in a tree. Nodes are objects thTht contain values and can refer to other nodes. A parent node contains child nodes, and the child nodes can be parents to other nodes. Two child nodes that have the same parent node are considered sibling nodes. A tree is a collection of nodes, usually organized in a hierarchical manner. The first parent node of a tree is the root node.

18 Bina Nusantara University 18 TreeView properties and an event

19 Bina Nusantara University 19 TreeNode properties and methods

20 Bina Nusantara University 20 ListViews The ListView control is similar to a ListBox in that both display lists from which the user can select one or more items. ListView is more versatile and can display items in different formats. For example, a ListView can display icons next to the list items (controlled by its ImageList property) and show the details of items in columns.

21 Bina Nusantara University 21

22 Bina Nusantara University 22 Tab Control TabControl creates tabbed windows, such as those we have seen in Visual Studio. This allows you to specify more information in the same space on a Form and enables you to group displayed data logically. TabControls contain TabPage objects, which are similar to Panels and GroupBoxes in that TabPages also can contain controls. First ada controls to the TabPage objects, then add the TabPages to the TabControl. Only one TabPage is dispayed at a time. To add objects to the TabPage and the TabControl, write myTabPage.Controls.Add ( myControl ); myTabControl.TabPages.Add ( myTabPage );

23 Bina Nusantara University 23 TabControl properties and an event

24 Bina Nusantara University 24 MDI Windows Previously, we have built only single document interface (SDI) applications. SDI applications usually have limited abilties-Paint and Notepad for example have limited image-and text-editing features. To edit multiple documents, the user must execute another instance of the SDI application.

25 Bina Nusantara University 25 MDI Windows Many complex applications are multiple document interface (MDI) programs, which allow users to edit multiple documents at once. MDI programs also tend to be more complex-Paint Shop Pro and Photoshop have a greater number of image-editing features than does Paint. An MDI program’s main window is called the parent window, and each window inside the application is referred to as a child window. Although an MDI application can have many child windows, each has only one parent window.

26 Bina Nusantara University 26 MDI Windows In general, to add a child Form to a parent, write ChildFormClass childForm = New ChildFormClass(); childForm.MdiParent = parentForm; childForm.Show(); Child windows can be minimized, maximized and closed independently of the parent window.

27 Bina Nusantara University 27

28 Bina Nusantara University 28 References http://books.google.co.id/books?id=euV7e2f- RzsC&pg=PA472&lpg=PA472&dq=control+properties+and+l ayout+c%23&source=bl&ots=LCz4YdGcOB&sig=kFd6TiqM Wz2y3u8rAfaMDfmRVAg&hl=id&ei=s6ROS7rwNsqLkAXlxf2 cDQ&sa=X&oi=book_result&ct=result&resnum=6&ved=0CC EQ6AEwBQ#v=onepage&q=&f=false http://www.youtube.com/watch?v=nWBQseysWhc &feature=relatedhttp://www.youtube.com/watch?v=nWBQseysWhc &feature=related


Download ppt "Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010."

Similar presentations


Ads by Google