 2006 Pearson Education, Inc. All rights reserved. 1 13 Graphical User Interface Concepts: Part I.

Slides:



Advertisements
Similar presentations
Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
Advertisements

Microsoft Visual Basic: Reloaded Chapter Five More on the Selection Structure.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
© by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program. © by Pearson Education, Inc. All Rights Reserved.2.
© by Pearson Education, Inc. All Rights Reserved. continued …
Visual Basic 2010 How to Program Reference: Instructor: Maysoon Bin Duwais slides Visual Basic 2010 how to program by Deitel © by Pearson Education,
GUI-Labels, TextBoxes and Buttons Label- displays read-only text Common properties:  Font – font used by the text of label  Text – text to appear on.
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.
Copyright © 2012 Pearson Education, Inc. Chapter 2 Introduction to Visual C#
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Visual Basic Chapter 1 Mr. Wangler.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
Department of Mechanical Engineering, LSUSession VII MATLAB Tutorials Session VIII Graphical User Interface using MATLAB Rajeev Madazhy
Chapter 8: Writing Graphical User Interfaces
IE 411/511: Visual Programming for Industrial Applications
© 2006 Lawrenceville Press Slide 1 Chapter 3 Visual Basic Interface.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Week 2: WINDOWS PROGRAMMING Chapter 15 in “Beginning Visual C# 2010” ebook Chapter 4 in “”MCTS_Self-Paced_Training_Kit” ebook.
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 2 More Controls Programming in C#. NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.
Java Software Solutions Lewis and Loftus Chapter 10 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Graphical User Interfaces --
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 4 I Need a Tour Guide.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
G RAPHICAL U SER I NTERFACE C ONCEPTS : P ART 1 1 Outline Introduction Windows Forms Event-Handling Model - Basic Event Handling.
Chapter One An Introduction to Visual Basic 2010 Programming with Microsoft Visual Basic th Edition.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Chapter 12 - Graphical User Interface Concepts: Part.
Visual C# 2012 How to Program 1. 2  A graphical user interface (GUI) allows a user to interact visually with a program.  Figure 14.1 shows a Visual.
Chapter 8 Collecting Data with Forms. Chapter 8 Lessons Introduction 1.Plan and create a form 2.Edit and format a form 3.Work with form objects 4.Test.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
1 Chapter Eleven Handling Events. 2 Objectives Learn about delegates How to create composed delegates How to handle events How to use the built-in EventHandler.
CHAPTER TWO Creating Simple Visual Basic.NET Windows Applications.
Creating Graphical User Interfaces (GUI’s) with MATLAB By Jeffrey A. Webb OSU Gateway Coalition Member.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Chapter 2 – Introduction to the Visual Studio .NET IDE
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.
Graphical Enablement In this presentation… –What is graphical enablement? –Introduction to newlook dialogs and tools used to graphical enable System i.
Copyright © 2015 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 13 GUI Programming.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 4 Working with Variables, Constants, Data Types, and Expressions.
Object-Oriented Application Development Using VB.NET 1 Chapter 10 VB.NET GUI Components Overview.
Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 4 Designing the Inventory Application Introducing TextBox es and Button s.
Chapter 2 More Controls Programming in C#. NET Objectives Use text boxes, group boxes, check boxes, radio buttons, and picture boxes effectively.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
 2002 Prentice Hall. All rights reserved. 1 Outline Mouse Event Handling Keyboard Event Handling Graphical User Interface Concepts:
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
 You won’t write a single line of program code.  Instead, you’ll use visual programming techniques.  Visual Studio processes your actions (such as mouse.
Graphical User Interface Concepts - Part 1 Session 08 Mata kuliah: M0874 – Programming II Tahun: 2010.
 2007 Pearson Education, Inc. All rights reserved Graphical User Interface Concepts: Part 1.
Chapter 1: An Introduction to Visual Basic 2015
Chapter 8: Writing Graphical User Interfaces
Chapter 2 – Introduction to the Visual Studio .NET IDE
Graphical User Interface Concepts: Part I
Program and Graphical User Interface Design
Chap 7. Building Java Graphical User Interfaces
Graphical User Interfaces -- Introduction
Visual programming Chapter 3: GUI (Graphical User Interface) Part I
Program and Graphical User Interface Design
Graphical User Interface Concepts: Part I
Chapter 14 Graphical User Interfaces with Windows Forms: Part 1
Overview of the IDE Visual Studio .NET is Microsoft’s Integrated Development Environment (IDE) for creating, running and debugging programs (also.
Week 2: WINDOWS PROGRAMMING
Presentation transcript:

 2006 Pearson Education, Inc. All rights reserved Graphical User Interface Concepts: Part I

 2006 Pearson Education, Inc. All rights reserved. 2 …the wisest prophets make sure of the event first. — Horace Walpole...The user should feel in control of the computer; not the other way around. This is achieved in applications that embody three qualities: responsiveness, permissiveness, and consistency. — Inside Macintosh, Volume 1 Apple Computer, Inc All the better to see you with my dear. — The Big Bad Wolf to Little Red Riding Hood

 2006 Pearson Education, Inc. All rights reserved. 3 OBJECTIVES In this chapter you will learn:  Design principles of graphical user interfaces (GUIs).  How to create graphical user interfaces.  How to process events that are generated by user interactions with GUI controls.  The namespaces that contain the classes for graphical user interface controls and event handling.  How to create and manipulate Button, Label, RadioButton, CheckBox, TextBox, Panel and NumericUpDown controls.  How to add descriptive ToolTip s to GUI controls.  How to process mouse and keyboard events.

 2006 Pearson Education, Inc. All rights reserved Introduction 13.2 Windows Forms 13.3 Event Handling A Simple Event-Driven GUI Another Look at the Visual Studio Generated Code Delegates and the Event-Handling Mechanism Other Ways to Create Event Handlers Locating Event Information 13.4 Control Properties and Layout 13.5 Label s, TextBox es and Button s 13.6 GroupBox es and Panel s 13.7 CheckBox es and RadioButton s 13.8 PictureBox es

 2006 Pearson Education, Inc. All rights reserved ToolTip s NumericUpDown Control Mouse-Event Handling Keyboard-Event Handling Wrap-Up

 2006 Pearson Education, Inc. All rights reserved Introduction Graphical User Interface (GUI) – Gives a program distinctive “look” and “feel” – Built from GUI controls (Fig. 13.2) Objects that can display information on the screen or enable users to interact with an application Implements IComponent interface

 2006 Pearson Education, Inc. All rights reserved. 7 Look-and-Feel Observation 13.1 Consistent user interfaces enable a user to learn new applications more quickly because the applications have the same “look” and “feel.”

 2006 Pearson Education, Inc. All rights reserved. 8 Fig | GUI controls in an Internet Explorer window. LabelButton Menu bar Title barMenuCombobox Scrollbar

 2006 Pearson Education, Inc. All rights reserved. 9 Fig | Some basic GUI controls.

 2006 Pearson Education, Inc. All rights reserved Windows Forms Windows Forms – Used to create GUIs for programs – Graphical element that appears on your computer’s desktop – Active window is the front most window – A Form is a container for controls and components – In visual programming, Visual Studio generates much of the GUI-related code

 2006 Pearson Education, Inc. All rights reserved. 11 Fig | Components and controls for Windows Forms. Display all controls and components Categories that organize controls and components by functionality

 2006 Pearson Education, Inc. All rights reserved. 12 Fig | Common Form properties, methods and events.

 2006 Pearson Education, Inc. All rights reserved Event Handling Event Handling – GUIs are event driven – When user interacts with a GUI component, the interaction is known as an event – A method that performs a task in response to an event is called an event handler

 2006 Pearson Education, Inc. All rights reserved A Simple Event-Driven GUI Can create a Click event handler by double clicking the Button control on the Form (if applicable) By convention – Each variable name we create for a control ends with the control’s type – C# names the event-handler method as controlName_eventName (e.g., clickButton_Click) Each event handler receives two parameters when called – object named sender A reference to the object that generated the event – EventArgs named e Contains additional information about the event that occurred

 2006 Pearson Education, Inc. All rights reserved. 15 Outline SimpleEventExample Form.cs The click event handler for clickButton Let user know that clickButton was clicked by displaying MessageBox Inherits from Form Visual Studio generated InitializeComponent

 2006 Pearson Education, Inc. All rights reserved. 16 Software Engineering Observation 13.1 You should not expect return values from event handlers—event handlers are designed to execute code based on an action and return control to the main program.

 2006 Pearson Education, Inc. All rights reserved. 17 Good Programming Practice 13.1 Use the event-handler naming convention controlName_eventName, so method names are meaningful. Such names tell users what event a method handles for what control. This convention is not required, but it makes your code easier to read, understand, modify and maintain.

 2006 Pearson Education, Inc. All rights reserved Another Look at the Visual Studio Generated Code Visual Studio Generated Code – The auto-generated code is saved in the Designer.cs file of the Form – partial modifier allow the class created to be split among multiple files – By default, all variable declarations for controls created through C# have a private access modifier – The code also includes Dispose and InitializeComponent

 2006 Pearson Education, Inc. All rights reserved. 19 Fig | First half of the Visual Studio generated code file.

 2006 Pearson Education, Inc. All rights reserved. 20 Fig | Second half of the Visual Studio generated code file.

 2006 Pearson Education, Inc. All rights reserved. 21 Error-Prevention Tip 13.1 The code generated by building a GUI in Design mode is not meant to be modified directly, and doing so can result in an application that functions incorrectly. You should modify control properties through the Properties window.

 2006 Pearson Education, Inc. All rights reserved Delegates and the Event-Handling Mechanism Delegates and the Event-Handling Mechanism – Event sender Control that generates an event – Event receiver Responds to a particular event – Delegates Hold a reference to a method with a signature delegate keyword Multicast delegates – Represent a set of delegate objects that all have same signature

 2006 Pearson Education, Inc. All rights reserved Other Ways to Create Event Handlers Other ways to create event handlers – By double clicking a control, the Form creates a event handler for that control – Able to create additional event handlers through the Properties window (Fig. 13.8)

 2006 Pearson Education, Inc. All rights reserved. 24 Fig | Viewing events for a Button control in the Properties window. Properties icon Events icon Selected events

 2006 Pearson Education, Inc. All rights reserved Locating Event Information Read the Visual Studio documentation to learn about the different events raised (Fig )

 2006 Pearson Education, Inc. All rights reserved. 26 Fig | List of Button events. Class name List of events

 2006 Pearson Education, Inc. All rights reserved. 27 Fig | Click event details. Event name Event type Event argument class

 2006 Pearson Education, Inc. All rights reserved Control Properties and Layout Control Properties and Layout – Focus method Transfers the focus to a control and makes it the active control – Enabled property Indicates whether the user can interact with a control to generate an event – Anchoring property Causes controls to remain at a fixed distance from the sides of the container (Fig – 13.13) – Docking property Attaches a control to a container such that the control stretches across an entire side (Fig ) – Padding property Specifies the distance between the docked controls and the Form edges – Width and Height Specifies size of Form Using Visual Studio To Edit GUI’s Layout – Snap lines Appear to help you position the control with respect to other controls

 2006 Pearson Education, Inc. All rights reserved. 29 Fig | Class Control properties and methods. (Part 1 of 2)

 2006 Pearson Education, Inc. All rights reserved. 30 Fig | Class Control properties and methods. (Part 2 of 2)

 2006 Pearson Education, Inc. All rights reserved. 31 Fig | Manipulating the Anchor property of a control. Click down-arrow in Anchor property to display anchoring window Anchoring window Darkened bars indicate the container’s side(s) to which the control is anchored; use mouse clicks to select or deselect a bar

 2006 Pearson Education, Inc. All rights reserved. 32 Fig | Anchoring demonstration. Constant distance to right and bottom sides Before resizing After resizing

 2006 Pearson Education, Inc. All rights reserved. 33 Fig | Docking a Button to the top of a Form. Before resizing After resizing Control extends along entire top portion of form

 2006 Pearson Education, Inc. All rights reserved. 34 Fig | Control layout properties.

 2006 Pearson Education, Inc. All rights reserved. 35 Look-and-Feel Observation 13.2 For resizable Form s, ensure that the GUI layout appears consistent across various Form sizes.

 2006 Pearson Education, Inc. All rights reserved. 36 Fig | Snap lines in Visual Studio Snap line to help align controls on their left sides Snap line that indicates when a control reaches the minimum recommended distance from the edge of a Form.

 2006 Pearson Education, Inc. All rights reserved Label s, TextBoxe s and Button s Label s – Provide text information (as well as images) – Display text that user cannot directly modify – Can be changed programmatically TextBoxe s – Area in which either text can be displayed or typed in – Password TextBoxe s hides information entered by user Button s – Control that user clicks to trigger specific action – There are several types of buttons, such as checkboxes and radio buttons – All buttons derive from class ButtonBase

 2006 Pearson Education, Inc. All rights reserved. 38 Fig | Common Label properties.

 2006 Pearson Education, Inc. All rights reserved. 39 Fig | TextBox properties and events.

 2006 Pearson Education, Inc. All rights reserved. 40 Fig | Button properties and event.

 2006 Pearson Education, Inc. All rights reserved. 41 Look-and-Feel Observation 13.3 Although Label s, TextBox es and other controls can respond to mouse clicks, Button s are more natural for this purpose.

 2006 Pearson Education, Inc. All rights reserved. 42 Outline LabelTextBoxButton TestForm.cs (1 of 2)

 2006 Pearson Education, Inc. All rights reserved. 43 Outline LabelTextBoxButton TestForm.cs (2 of 2) The click event handler for displayPasswordButton Display the password protected text in displayPasswordLabel

 2006 Pearson Education, Inc. All rights reserved GroupBoxe s and Panel s GroupBoxe s and Panel s – Arrange controls on a GUI – Used to group similar functionality that a related – Primary difference between these two controls: GroupBoxe s can display a caption (i.e., text) and do not include scrollbars Panel s can include scrollbars and do not include a caption

 2006 Pearson Education, Inc. All rights reserved. 45 Look-and-Feel Observation 13.4 Panel s and GroupBox es can contain other Panel s and GroupBox es for more complex layouts.

 2006 Pearson Education, Inc. All rights reserved. 46 Fig | GroupBox properties.

 2006 Pearson Education, Inc. All rights reserved. 47 Fig | Panel properties.

 2006 Pearson Education, Inc. All rights reserved. 48 Look-and-Feel Observation 13.5 You can organize a GUI by anchoring and docking controls inside a GroupBox or Panel. The GroupBox or Panel then can be anchored or docked inside a Form. This divides controls into functional “groups” that can be arranged easily.

 2006 Pearson Education, Inc. All rights reserved. 49 Look-and-Feel Observation 13.6 Use Panel s with scrollbars to avoid cluttering a GUI and to reduce the GUI’s size.

 2006 Pearson Education, Inc. All rights reserved. 50 Fig | Creating a Panel with scrollbars. Control inside Panel Panel Scrollbars Panel Panel resized

 2006 Pearson Education, Inc. All rights reserved. 51 Outline GroupboxPanelExamp leForm.cs (1 of 2) The click event handler for hiButton The click event handler for byeButton Change messageLabel ’s text

 2006 Pearson Education, Inc. All rights reserved. 52 Outline GroupboxPanelExamp leForm.cs (2 of 2) The click event handler for leftButton Change messageLabel ’s text The click event handler for rightButton Change messageLabel ’s text

 2006 Pearson Education, Inc. All rights reserved CheckBox es and RadioButton s C# has two types of state buttons – CheckBoxe s Small squares that either is blank or contains a check mark Any number of CheckBoxe s can be selected at a time Font styles can be combined via bitwise operators – RadioButton s Only one can be selected at a time Selecting one RadioButton in the group forces all the others to be deselected. RadioButton s represents a set of mutually exclusive options

 2006 Pearson Education, Inc. All rights reserved. 54 Fig | CheckBox properties and events.

 2006 Pearson Education, Inc. All rights reserved. 55 Outline CheckBoxTestForm.cs (1 of 2) The event handler for boldCheckBox when user checks or unchecks Bold the font of outputLabel if not done so already and vice versa

 2006 Pearson Education, Inc. All rights reserved. 56 Outline CheckBoxTestForm.cs (2 of 2) The event handler for italicCheckBox when user checks or unchecks Italicize the font of outputLabel if not done so already and vice versa

 2006 Pearson Education, Inc. All rights reserved. 57 Look-and-Feel Observation 13.7 Use RadioButton s when the user should choose only one option in a group.

 2006 Pearson Education, Inc. All rights reserved. 58 Look-and-Feel Observation 13.8 Use CheckBox es when the user should be able to choose multiple options in a group.

 2006 Pearson Education, Inc. All rights reserved. 59 Fig | RadioButton properties and events.

 2006 Pearson Education, Inc. All rights reserved. 60 Software Engineering Observation 13.2 Form s, GroupBox es, and Panel s can act as logical groups for RadioButton s. The RadioButtons within each group are mutually exclusive to each other, but not to RadioButton s in different logical groups.

 2006 Pearson Education, Inc. All rights reserved. 61 Outline RadioButtonsTest Form.cs (1 of 7) Variables to determine how MessageBox will look like Determine which buttons the user selected and store information in buttonType

 2006 Pearson Education, Inc. All rights reserved. 62 Outline RadioButtonsTest Form.cs (2 of 7) Determine which buttons the user selected and store information in buttonType Determine which icon the user selected and store information in iconType

 2006 Pearson Education, Inc. All rights reserved. 63 Outline RadioButtonsTest Form.cs (3 of 7) Determine which icon the user selected and store information in iconType

 2006 Pearson Education, Inc. All rights reserved. 64 Outline RadioButtonsTest Form.cs (4 of 7) The click event handler for displayButton Display customized MessageBox

 2006 Pearson Education, Inc. All rights reserved. 65 Outline RadioButtonsTest Form.cs (5 of 7) Test to see which button was pressed and change displayLabel ’s text accordingly

 2006 Pearson Education, Inc. All rights reserved. 66 Outline RadioButtonsTest Form.cs (6 of 7) (c) OKCance l button type (a) (b) (e) AbortRetryIgnore button type (d) OK button type (f) YesNoCance l button type

 2006 Pearson Education, Inc. All rights reserved. 67 Outline RadioButtonsTest Form.cs (7 of 7) (h) RetryCance l button type (g) YesNo button type

 2006 Pearson Education, Inc. All rights reserved PictureBoxe s PictureBoxe s – Display an image

 2006 Pearson Education, Inc. All rights reserved. 69 Fig | PictureBox properties and event.

 2006 Pearson Education, Inc. All rights reserved. 70 Outline PictureBoxTestForm.cs (1 of 2) Assign an image to the imagePictureBox given the specified directory

 2006 Pearson Education, Inc. All rights reserved. 71 Outline PictureBoxTestForm.cs (2 of 2) (a) (b) (c)

 2006 Pearson Education, Inc. All rights reserved ToolTip s ToolTip s – Helpful text that appears when the mouse hovers over an item

 2006 Pearson Education, Inc. All rights reserved. 73 Fig | ToolTip properties and events.

 2006 Pearson Education, Inc. All rights reserved. 74 Outline ToolTipExampleForm.cs (a) (b)

 2006 Pearson Education, Inc. All rights reserved. 75 Fig | Demonstrating the component tray. ToolTip in component tray

 2006 Pearson Education, Inc. All rights reserved. 76 Fig | Setting a control’s tool tip text. Property to set tool tip text Tool tip text

 2006 Pearson Education, Inc. All rights reserved NumericUpDown Control NumericUpDown – Restrict a user’s input choices to a specific range of numeric values. – Appears as a TextBox, with two small Buttons on the right side – NumericUpDown ’s ReadOnly property indicates if user can type a number into the control

 2006 Pearson Education, Inc. All rights reserved. 78 Fig | NumericUpDown properties and event.

 2006 Pearson Education, Inc. All rights reserved. 79 Outline interestCalculator Form.cs (1 of 2) Retrieve, convert, and assign principalTextBox, InterestTextBox, and yearUpDown ’s values

 2006 Pearson Education, Inc. All rights reserved. 80 Outline interestCalculator Form.cs (2 of 2) Click to increase number of years Click to decrease number of years NumericalUpDown control Calculate interest and format it as a String Output results in displayTextBox

 2006 Pearson Education, Inc. All rights reserved Mouse-Event Handling Mouse-Event Handling – Mouse events can be handled for any control that derives from class System.Windows.Forms.Control – Class MouseEventArgs Contains information related to the mouse event Information about the event is passed to the event-handling method through an object of this class – The delegate used to create the mouse-event handlers is MouseEventHandler

 2006 Pearson Education, Inc. All rights reserved. 82 Fig | Mouse events and event arguments. (Part 1 of 2.)

 2006 Pearson Education, Inc. All rights reserved. 83 Fig | Mouse events and event arguments. (Part 2 of 2.)

 2006 Pearson Education, Inc. All rights reserved. 84 Outline PainterForm.cs (1 of 2) Default instance variable to false to identify that painting will not occur Set shouldPaint to true to identify that painting will occur Set shouldPaint to false to identify that painting will not occur

 2006 Pearson Education, Inc. All rights reserved. 85 Outline PainterForm.cs (1 of 2) Paint on the Form when mouse is being pressed

 2006 Pearson Education, Inc. All rights reserved Keyboard-Event Handling Keyboard-Event Handling – Key events occur when keyboard keys are pressed and released – There are three key events: KeyPress – The event occurs when the user presses a key that represents an ASCII character The specific key can be determined with property KeyChar of the event handler’s KeyPressEventArgs argument Does not indicate whether modifier keys were pressed KeyUp and KeyDown – If information about the modifier keys are important, use the KeyUp or KeyDown events The KeyEventArgs argument for each of these events contains information about modifier keys.

 2006 Pearson Education, Inc. All rights reserved. 87 Fig | Keyboard events and event arguments. (Part 1 of 2.)

 2006 Pearson Education, Inc. All rights reserved. 88 Fig | Keyboard events and event arguments. (Part 2 of 2.)

 2006 Pearson Education, Inc. All rights reserved. 89 Outline KeyDemoForm.cs (1 of 3) Property that returns the ASCII character for the key pressed

 2006 Pearson Education, Inc. All rights reserved. 90 Outline KeyDemoForm.cs (2 of 3) Reset labels Return the key code for the key as a value from the Keys enumerations Returns the key code for a key combined with modifier information as a Key value Returns key code as an int

 2006 Pearson Education, Inc. All rights reserved. 91 Outline KeyDemoForm.cs (3 of 3) (c) $ pressed (a) H pressed (b) F12 pressed (d) Enter pressed