Graphical User Interfaces Part 2 1 Outline TreeViews ListViews Tab Control.

Slides:



Advertisements
Similar presentations
 2006 Pearson Education, Inc. All rights reserved Graphical User Interface Concepts: Part 2.
Advertisements

© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
Chapter 2 –Visual Basic, Controls, and Events
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
C# Programming: From Problem Analysis to Program Design1 9 Programming Based on Events.
Common Windows Controls. Objectives Learn about common Windows controls Load, display, and share images with other control instances using the ImageList.
 2007 Dr. Natheer Khasawneh. All rights reserved. 1 Chapter 14 – Graphical User Interfaces Part 2 Outline 14.9 TreeViews ListViews TabControl.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
Programming Based on Events
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Graphical User Interface (GUI) A GUI allows user to interact with a program visually. GUIs are built from GUI components. A GUI component is an object.
Programming Based on Events
Chapter 31 Visual Basic Controls A Form is a windows-style screen displayed by Visual Basic programs. In a form, a programmer can create objects in a form.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
Chapter 13: Advanced GUI and Graphics
Tutorial Holdings Management Adding, Editing, and Assigning Notes support.ebsco.com.
Chapter 2 –Visual Basic, Controls, and Events
BİL528 – Bilgisayar Programlama II Advanced Controls, Menus, Toolbars, and Status Bars 1.
Directory and File. Access Files in a Directory Name space: System.IO The Directory and File classes contain only shared methods that set or return information.
Windows Programming Using C#
1 Graphical User Interfaces Part 2 Outline Multiple Document Interface (MDI) Windows Visual Inheritance User-Defined Controls.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Introducing Web Controls Outline 29.1 Analyzing the.
1 Graphical User Interfaces Part 2 Outline ListBoxes and CheckedListBoxes ListBoxes CheckedListBoxes ComboBoxes.
Chapter 8: Writing Graphical User Interfaces
Menus,MonthCalender, DateTimePicker, MDI,Tree View, List View,
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
Introduction to Visual Basic.NET Chapter 2 Introduction to Controls, Events.
Some Interesting Controls. Controls We've UsedNew Controls LabelListBox TextBoxCheckedListBox ComboBoxTabControl ButtonTabPage Menu MenuItem TreeView.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 13 – Graphical User Interfaces Part 2 Outline.
Graphical User Interface Concepts - Part 2 Session 09 Mata kuliah: M0874 – Programming II Tahun: 2010.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Graphical User Interfaces 2 Tonga Institute of Higher Education.
Chapter 2 –Visual Basic, Controls, and Events
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Controls. Adding Controls to Form -You can pick controls from the toolbox. -To add the controls from Toolbox to the Form You have be in design view. -To.
1 Chapter Ten Using Controls. 2 Objectives Learn about Controls How to create a Form containing Labels How to set a Label’s Font How to add Color to a.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Topics Introduction Scene Graphs
 2002 Prentice Hall. All rights reserved. 1 Chapter 13 – Graphical User Interfaces Part 2 Outline 13.1 Introduction 13.2 Menus 13.3 LinkLabels 13.4 ListBoxes.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Starting Out with Programming Logic & Design Second Edition by Tony Gaddis.
Win32 Controls & ActiveX Integration In this presentation… –Introduction to the new Win32 controls. What they are? How they are enabled? Potential uses.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
Swing - 2 Session 13. Swing - 2 / 2 of 38 Objectives (1) Discuss trees and tables Discuss progress bars Discuss MVC architecture Describe menus.
Controls. Common properties Height – Height of the control Left – Left of the control Width – width of a control Top - From the screen top Font – Foreground.
APPX Design Environment Futures Planned development.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Graphical User Interface Components Version 1.1. Obectives Students should understand how to use these basic Form components to create a Graphical User.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Chapter 2 - VB 2008 by Schneider1 Chapter 2 –Visual Basic, Controls, and Events 2.1 An Introduction to Visual Basic 2.2 Visual Basic Controls 2.3 Visual.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
COMPUTER PROGRAMMING I Apply Procedures to Develop List Box and Combo Box Objects.
Graphical User Interface
Chapter 8: Writing Graphical User Interfaces
Chapter 22 Tree View and List View
Graphical User Interfaces Part 2
TreeView Control.
Programming Based on Events
Windows Forms GUI: A Deeper Look
Visual programming Chapter 4: GUI (Graphical User Interface) Part II
Web Development Using ASP .NET
Visual Programming Dr /Usama Abo Zaid PREPARED BY / MOSTAFA MOHAMED MOSTAFA.
Visual C# - GUI and controls - 1
Presentation transcript:

Graphical User Interfaces Part 2 1 Outline TreeViews ListViews Tab Control

TreeView 2 Click to expand node, displaying child nodes Root node Child nodes Click to collapse node, hiding child nodes

TreeView Displays nodes hierarchically Parent nodes have children The first parent node is called the root Use Add method to add nodes 3

TreeView Properties Nodes – lists the collection of TreeNode s in the control. SelectedNode ImageList - Used to display icons by the nodes CheckBoxes – indicates whether checkboxes appear next to nodes (default is false) Common Events AfterSelect – generated after selected node changes (default) 4

TreeNode Properties Text – text displayed in TreeView Nodes – collection of TreeNodes contained in current node FirstNode, LastNode – 1 st and last child in in Nodes PrevNode, NextNode – refers to sibling nodes FullPath – indicates path of node, starting at root of tree SelectedImageIndex – image to use when node selected ImageIndex – image to use when node de-selected Common Methods Collapse Expand ExpandAll GetNodeCount – returns the number of child nodes 5

TreeView 6 To add nodes in design view Right click, select Edit Nodes Or click the ellipsis by the Nodes property in the Properties window. This opens TreeNode Editor

TreeView 7 Property Nodes methods –Add, Clear, Remove myTreeView.Nodes.Add (new TreeNode (RootLabel);

8

ListView s Displays list of items Similar to ListBox, can select one or more items from list Displays icons to go along with items Properties Items – collection in the control SelectedItems – list currently selected items View – determines appearance (LargeIcon, SmallIcon, List, Details) SmallImageList, LargeImageList – images to use when displaying icons Activation – determines how user activates an item (OneClick, TwoClick (changes color) and Standard (double-click) CheckBoxes – items appear with checkboxes (default is false) 9

ListView s Properties MultiSelect – default is true Common Event ItemActivate – generated when an item in the ListView is activated. Does not specify which item is activated. 10

ListView 11 Image Collection Editor window for an ImageList component.

TabControl Programmer can design GUI that have a large number of controls or data without using a large amount of screen space. TabControl creates tabbed windows called TabPage objects TabPages can have controls Tabpages have own Click event for when tab is clicked 12

Tab Control s 13 Example TabControl with TabPage s. TabPage TabControl Controls in TabPage

Tab Control s 14 Adding TabPage s to the TabControl. TabControl

TabControl s 15

16

public class UsingTabs : System.Windows.Forms.Form { // output label reflects text changes private System.Windows.Forms.Label displayLabel; // table control containing table pages colorTabPage, // sizeTabPage, messageTabPage and aboutTabPage private System.Windows.Forms.TabControl optionsTabControl; // table page containing color options private System.Windows.Forms.TabPage colorTabPage; private System.Windows.Forms.RadioButton greenRadioButton; private System.Windows.Forms.RadioButton redRadioButton; private System.Windows.Forms.RadioButton blackRadioButton; 17 Color tab Color buttons for color tab TabControl

// event handler for green color radio button private void greenRadioButton_CheckedChanged ( object sender, System.EventArgs e ) { displayLabel.ForeColor = Color.Green; } // event handler for size 12 radio button private void size12RadioButton_CheckedChanged ( object sender, System.EventArgs e ) { displayLabel.Font = new Font( displayLabel.Font.Name, 12 ); } // event handler for message "Hello!" radio button private void helloRadioButton_CheckedChanged ( object sender, System.EventArgs e ) { displayLabel.Text = "Hello!"; } 18 Event handlers