Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.

Slides:



Advertisements
Similar presentations
What is a Dialog box? A Dialog box is a window or “form” that contains other child windows or “controls” that have a specific appearances and pre-defined.
Advertisements

Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
C# Programming: From Problem Analysis to Program Design1 9 Programming Based on Events.
Chapter 6 Graphical User Interface (GUI) and Object-Oriented Design (OOD)
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
MENUS AND THE MENU EDITOR Elements of a Menu Menu bar Menu title Separator bar Menu items.
Chapter 13: Advanced GUI and Graphics
C# Programming: From Problem Analysis to Program Design1 Introduction to Windows Programming C# Programming: From Problem Analysis to Program Design 3.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Slide 1 Chapter 2 Visual Basic Interface. Slide 2 Chapter 2 Windows GUI  A GUI is a graphical user interface.  The interface is what appears on the.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Visual Basic Chapter 1 Mr. Wangler.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
Microsoft Visual Basic 2008 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 8: Writing Graphical User Interfaces
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
Chapter 3 Introducing Visual Basic.NET. 3.1 Visual Basic.NET Windows Programming -Used to create Windows, Web, and Console applications -Uses predefined.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Chapter 1: An Introduction to Visual Basic 2005 Programming with Microsoft Visual Basic 2005, Third Edition.
Multiple Forms, Container Controls, AddHandler This presentation is based on the Forms and ContainerControls VB Projects 1.
Chapter 12: Using Controls. Examining the IDE’s Automatically Generated Code A new Windows Forms project has been started and given the name FormWithALabelAndAButton.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
Tutorial 111 The Visual Studio.NET Environment The major differences between Visual Basic 6.0 and Visual Basic.NET are the latter’s support for true object-oriented.
XP New Perspectives on Windows XP Tutorial 1 Exploring the Basics.
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.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 - Graphical User Interface Concepts: Part.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 13 Introduction to Classes.
Dreamweaver MX. 2 Overview of Templates n Forms enable you to collect data from ______. n A form contains ________ such as text fields, radio buttons,
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
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.
CS324e - Elements of Graphics and Visualization Java GUIs - Event Handling.
Microsoft Visual Basic 2012 CHAPTER ELEVEN Multiple Classes and Inheritance.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
CMPF114 Computer Literacy Chapter 3 The Visual Basic Environment 1.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Visual Basic.NET BASICS Lesson 14 Menus and Printing.
COMPUTER PROGRAMMING I 3.01 Apply Controls Associated With Visual Studio Form.
Graphical User Interfaces Part 2 1 Outline TreeViews ListViews Tab Control.
Microsoft Visual Basic 2012: Reloaded Fifth Edition Chapter One An Introduction to Visual Basic 2012.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
Graphical User Interface
Computing with C# and the .NET Framework
Topics Graphical User Interfaces Using the tkinter Module
Chapter 1: An Introduction to Visual Basic 2015
Chapter 8: Writing Graphical User Interfaces
3.01 Apply Controls Associated With Visual Studio Form
Graphical User Interface Concepts: Part I
1. Introduction to Visual Basic
3.01 Apply Controls Associated With Visual Studio Form
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
Chapter 2 Visual Basic Interface
Creating a Windows Forms User Interface
Web Development Using ASP .NET
Visual C# - GUI and controls - 1
Chapter 4 Enhancing the Graphical User Interface
Presentation transcript:

Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview

Object-Oriented Application Development Using VB.NET 2 Objectives In this chapter, you will: Learn about the GUI classes in VB.NET Understand the code generated by VB.NET Handle VB.NET events Work with additional GUI controls

Object-Oriented Application Development Using VB.NET 3 Introducing the GUI Classes in VB.NET Form –Instance of the Form class –Consists of GUI controls, such as Buttons Labels Text boxes Check boxes Radio buttons Tab pages Menu items Form class –Member of the System.Windows.Forms namespace

Object-Oriented Application Development Using VB.NET 4 Introducing the GUI Classes in VB.NET

Object-Oriented Application Development Using VB.NET 5 Introducing the GUI Classes in VB.NET Component class –Base class for all GUI components –An instance of a component does not have a visible, graphical representation Control class –A subclass of Component –An instance of a control has a visible, graphical representation

Object-Oriented Application Development Using VB.NET 6 Understanding the Code Generated by VB.NET Actions involved in visual programming –Creating a form –Setting properties of the form –Adding controls and components to the form –Setting properties of controls and components –Adding the code to handle events As the programmer adds controls and modifies properties, VB.NET generates the code

Object-Oriented Application Development Using VB.NET 7 Exploring the FormDemo Program FormDemo program –Contains A label A button –When the button is pressed, a message box appears

Object-Oriented Application Development Using VB.NET 8 Exploring the FormDemo Program FormDemo class –An instance of Form –Inherits methods from ContainerControl ScrollableControl Control Component

Object-Oriented Application Development Using VB.NET 9 Exploring the FormDemo Program FormDemo class definition –Specifies that the FormDemo class inherits from the Form class –Defines the constructor –Defines the Dispose method Dispose method is a destructor –Releases system resources when the program ends

Object-Oriented Application Development Using VB.NET 10 Exploring the FormDemo Program FormDemo class definition (Continued) –Declares an instance of the IContainer class IContainer: an interface that provides functionality for containers –Container: an object that holds other components –Declares controls that were created visually in Design window

Object-Oriented Application Development Using VB.NET 11 Exploring the FormDemo Program FormDemo class definition (Continued) –Defines the InitializeComponent method InitializeComponent method –Instantiates the label and button instances –Calls the SuspendLayout method –Sets the properties of the label, button and form instances –Defines the event handler

Object-Oriented Application Development Using VB.NET 12 Handling VB.NET Events GUI controls have associated event procedures The process of creating event procedures –Double-click a control in the Forms Designer window –VB.NET inserts the method header for the most commonly used event procedure for that control –Supply details that determine how the procedure responds to the event

Object-Oriented Application Development Using VB.NET 13 Working with Additional GUI Controls Look and feel –Style and appearance of each form in an application Design goals –Consistent look and feel for all the forms –Ease of use Purpose of each control should be intuitive to the user Layout of the form should be intuitive to the user

Object-Oriented Application Development Using VB.NET 14 Working with Additional GUI Controls Design goals (Continued) –Feedback to the user about Completion of actions –For example: adding a record to a file Data entry errors –Minimize the keystrokes required by the user Reduces the chance of data entry errors Makes forms easier to use

Object-Oriented Application Development Using VB.NET 15 Working with Additional GUI Controls Naming conventions for program variables –Benefits Improve program readability Facilitate program maintenance

Object-Oriented Application Development Using VB.NET 16 Working with Additional GUI Controls Standards –Developed at the outset of a project –Enforced rigorously throughout the development process –Deal with Form design Variable naming conventions

Object-Oriented Application Development Using VB.NET 17 Reviewing Forms, Buttons, and Labels GUI controls –Subclasses of the Control class –Inherit properties, methods, and events from the Control class –Have additional methods and properties Help facility –Contains information about the methods and properties of GUI controls

Object-Oriented Application Development Using VB.NET 18 Using Text Boxes and Combo Boxes Text boxes –Display textual information to the user –Enable input of text from the keyboard –Functionality provided by the TextBox class Combo boxes –Extend the functionality of a text box –Allow the user to: Type a value Select an item from a predetermined list of values –Functionality provided by the ComboBox class

Object-Oriented Application Development Using VB.NET 19 Using Text Boxes and Combo Boxes

Object-Oriented Application Development Using VB.NET 20 Using Check Boxes and Radio Buttons Check boxes and radio buttons –Provide the ability to select from options –Have two states at any given point in time Checked (selected) Not checked (not selected) –Functionality provided by the CheckBox and RadioButton classes

Object-Oriented Application Development Using VB.NET 21 Using Check Boxes and Radio Buttons A check box –Appears as a small white box –Usually includes a label that identifies its purpose The caption (or label) is set by the Text property –When selected A check mark appears in the box –Multiple check boxes There is no requirement that any check box be checked Any or all of the check boxes may be checked simultaneously

Object-Oriented Application Development Using VB.NET 22 Using Check Boxes and Radio Buttons Radio buttons –Appear as small white circles –Have captions (or labels) that identify their purpose –When selected A black dot appears within the circle –A group of radio buttons Represents a set of related options Options are mutually exclusive: one and only one of the options may be selected at any given time

Object-Oriented Application Development Using VB.NET 23 Using Group Boxes and Panels Group boxes and panels –Containers used to visually and logically organize groups of related controls A group box –Includes a border (or frame) –Does not include scroll bars –Usually has a caption

Object-Oriented Application Development Using VB.NET 24 Using Group Boxes and Panels A panel –Does not include a border by default –May include scroll bars –Does not have captions Nested panels and group boxes –A group box or panel may contain other group boxes or panels

Object-Oriented Application Development Using VB.NET 25 Using Group Boxes and Panels A common use of group boxes and panels –Can be used to group a set of radio buttons Mutually exclusive behavior is enforced separately for each group

Object-Oriented Application Development Using VB.NET 26 Using List Boxes and Checked List Boxes List boxes and checked list boxes –Provide the ability to select one or more items from a predetermined list of values List boxes –Instances of the ListBox class –Enable the user (by default) to select one item from the list Selection of multiple list items can be enabled by setting the SelectionMode property

Object-Oriented Application Development Using VB.NET 27 Using List Boxes and Checked List Boxes Checked list boxes –Instances of the CheckedListBox class –Include a check box to the left of each item in the list –By default, allow the selection of multiple items in the list –When an item is selected A check mark appears in the corresponding check box

Object-Oriented Application Development Using VB.NET 28 Using Tree Views and Tree Nodes A tree view –Supported by the TreeView class –Displays a group of hierarchically related items –An item (or tree node) Represented as an instance of the TreeNode class –Appears as an expandable outline

Object-Oriented Application Development Using VB.NET 29 Using Tree Views and Tree Nodes

Object-Oriented Application Development Using VB.NET 30 Using Date/Time Pickers A date/time picker control –An instance of the DateTimePicker class –Used to Select a date and time from a calendar Display the date and time in a number of different formats

Object-Oriented Application Development Using VB.NET 31 Using Date/Time Pickers

Object-Oriented Application Development Using VB.NET 32 Using Tab Controls and Tab Pages A tab control –An instance of the TabControl class –Provides the functionality for a set of tab pages Tab pages are useful when –A form requires a large number of controls –Those controls can easily be grouped into logical subsets

Object-Oriented Application Development Using VB.NET 33 Using Tab Controls and Tab Pages Each tab page –An instance of the TabPage class (a subclass of Panel) –Contains A subset of the controls A tab identifying its purpose

Object-Oriented Application Development Using VB.NET 34 Using Main Menus and Menu Items MainMenu and MenuItem classes –Used to create a set of menus and submenus for a form Main menu control –Container for the menu structure Menu items –Represent individual menu choices within the menu structure

Object-Oriented Application Development Using VB.NET 35 Summary Component is a superclass of all GUI classes Control is a superclass of all visible components Forms are containers for other components Text boxes can be used to display and input data Combo boxes can be used to –Display and input text –Select from a predefined list of values Check boxes and radio buttons enable users to select (deselect) from a list of options

Object-Oriented Application Development Using VB.NET 36 Summary Tree views and tree nodes display a group of hierarchically related data Date/time pickers enable users to select a date from a calendar Tab controls and tab pages are useful when a form requires a large number of controls Main menus and menu items allow you to create a set of menus and submenus