T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 21 Typing Application Introducing Keyboard Events, Menus, Dialogs and the Dictionary.

Slides:



Advertisements
Similar presentations
Microsoft Visual Basic: Reloaded Chapter Seven More on the Repetition Structure.
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 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
 2006 Pearson Education, Inc. All rights reserved Introduction to the Visual C# 2005 Express Edition IDE.
C# Programming: From Problem Analysis to Program Design1 Programming Based on Events C# Programming: From Problem Analysis to Program Design 3 rd Edition.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Creating Menu. Objectives Create a menu system for a form –Create a menu –Create a menu titles –Create a menu items –Create a submenu –Modify menu –Edit.
Chapter 3 Introduction to Event Handling and Windows Forms Applications.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 9 Car Payment Calculator Application Introducing the Do While...Loop and Do Until...Loop.
Microsoft Visual Basic 2005 CHAPTER 8 Using Procedures and Exception Handling.
Chapter 8: String Manipulation
Microsoft Visual Basic 2005 CHAPTER 12 Cell Phone Applications and Web Services.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 6 Enhancing the Inventory Application Introducing Variables, Memory Concepts and.
Microsoft Visual Basic 2012 Using Procedures and Exception Handling CHAPTER SEVEN.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Flag Quiz Application Introducing One-Dimensional Arrays and ComboBox es.
5-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Interest Calculator Application Introducing the For...Next Repetition Statements.
IE 411/511: Visual Programming for Industrial Applications
VISUAL C++ PROGRAMMING: CONCEPTS AND PROJECTS Chapter 1B Introduction (Tutorial)
McGraw-Hill © 2009 The McGraw-Hill Companies, Inc. All rights reserved. Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Shipping Hub Application Introducing Generic Collections, LINQ, For Each...Next.
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. 1 2 Welcome Application Introducing the Visual Basic 2008 Express Edition IDE.
Chapter 5 Menus, Common Dialog Boxes, and Methods Programming in C#.NET © 2003 by The McGraw-Hill Companies, Inc. All rights reserved.
 2009 Pearson Education, Inc. All rights reserved Introduction to the Visual Basic Express 2008 IDE.
 2009 Pearson Education, Inc. All rights reserved Dive Into ® Visual C# 2008 Express.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 27 - Phone Book Application Introducing Multimedia.
1 The EDIT Program The Edit program is a full screen text editor that allows you to: Create text files Create text files Edit an existing text files Edit.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 8 Dental Payment Application Introducing CheckBox es and Message Dialogs.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 7 Using Menus, Common Dialogs, Procedures, Functions, and Arrays.
Windows Tutorial Common Objects ACOS: 1, 4. Using the Taskbar 1. Using the taskbar, you can switch between open programs and between open documents within.
Chapter 5 Menus, Common Dialog Boxes, Sub Procedures, and Function Procedures Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved CheckWriter Application Introducing Graphics and Printing.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Ticket Information Application Introducing Sequential-Access Files.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved. 1 3 Welcome Application Introduction to Visual Programming.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 17 – Flag Quiz Application Introducing One-Dimensional.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Security Panel Application Introducing the Select Case Multiple-Selection Statement.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Screen Scraping Application Introducing String Processing.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Class Average Application Introducing the Do...Loop While and Do...Loop Until.
Microsoft Office XP Illustrated Introductory, Enhanced Started with Windows 2000 Getting.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Microwave Oven Application Building Your Own Classes and Objects.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.
Visual C# 2012 How to Program © by Pearson Education, Inc. All Rights Reserved.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.1.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Application: Middle Tier Introducing Code-Behind Files, Session State.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 5.1 Test-Driving the Inventory Application.
Visual Basic 2010 How to Program © by Pearson Education, Inc. All Rights Reserved.1.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Bookstore Web Application: Client Tier Introducing Web Controls.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Craps Game Application Introducing Random-Number Generation and Enum.
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.
Creating Menus Menu Bar – behaves like standard Windows menus Can be used in place of or in addition to buttons to execute a procedure Menu items are controls.
Chapter 5 Menus, Sub Procedures and Sub Functions Programming In Visual Basic.NET.
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:
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
Compunet Corporation Programming with Visual Basic.NET Working with Menus and Dialog Boxes Week 14 Tariq Aziz and Kevin Jones.
Customizing Menus and Toolbars CHAPTER 12 Customizing Menus and Toolbars.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
 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.
Chapter 7 Multiple Forms, Modules, and Menus. Section 7.2 MODULES A module contains code—declarations and procedures—that are used by other files in a.
 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.
Dive Into® Visual Basic 2010 Express
Chapter 3: Introduction to Problem Solving and Control Statements
Presentation transcript:

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 Collection

 2009 Pearson Education, Inc. All rights reserved. 2 Outline 21.1 Test-Driving the Typing Application 21.2 Analyzing the Typing Application 21.3 Keyboard Events 21.4 IsNot Operator 21.5 Menus

 2009 Pearson Education, Inc. All rights reserved. 3 In this tutorial you will learn: ■Handle keyboard events. ■Create menus for your Windows applications. ■Use dialogs to display messages. ■Use the ShowDialog method of the Font and Color dialogs. ■Display the Font dialog to enable users to choose fonts. Objectives

 2009 Pearson Education, Inc. All rights reserved. 4 In this tutorial you will learn: ■Display the Color dialog to enable users to choose colors. ■Use operator IsNot to compare references. ■Use a Dictionary to store pairs of keys and values. ■Use LINQ to Objects to search a Form ’ s Controls collection. Objectives

Application Requirements  2009 Pearson Education, Inc. All rights reserved Test-Driving the Typing Application A high-school course teaches students how to type. The instructor would like to use a Windows application that allows students to watch what they are typing on the screen without looking at the keyboard. The application has to display a virtual keyboard that highlights any key the student presses on the real keyboard. This application must also contain menu commands for selecting the font style and color of the text displayed, clearing the text displayed and inverting the background and foreground colors of the display.

 2009 Pearson Education, Inc. All rights reserved. 6 Test-Driving the Typing Application ■Open the completed application and type a sentence into the TextBox (Fig. 21.1). Figure 21.1 | Typing application with key pressed. Virtual keyboard Display menu Highlighted key

 2009 Pearson Education, Inc. All rights reserved. 7 Test-Driving the Typing Application (Cont.) ■From the top menu, select Display > Text > Font... (Fig. 21.2). Figure 21.2 | Selecting the Font... menu item. Menu item Submenu

 2009 Pearson Education, Inc. All rights reserved. 8 Test-Driving the Typing Application (Cont.) ■The Font dialog (Fig. 21.3) appears. Figure 21.3 | Font dialog displayed when Display > Text > Font... is selected.

 2009 Pearson Education, Inc. All rights reserved. 9 Test-Driving the Typing Application (Cont.) ■Select Display > Text > Color... to display the Color dialog (Fig. 21.4). ■This dialog allows you to choose the color of the text displayed. Figure 21.4 | Color dialog displayed when Display > Text > Color... is selected.

 2009 Pearson Education, Inc. All rights reserved. 10 Test-Driving the Typing Application (Cont.) ■Select Display > Invert Colors (Fig. 21.5). Figure 21.5 | Selecting the Invert Colors menu item.

 2009 Pearson Education, Inc. All rights reserved. 11 Test-Driving the Typing Application (Cont.) ■This option allows you to swap the background and foreground colors (Fig. 21.6). Figure 21.6 | Output with colors inverted. ■Select Display > Clear TextBox to remove all the text from the TextBox.

 2009 Pearson Education, Inc. All rights reserved. 12 When the user presses a key: Highlight the corresponding Button on the GUI When the user releases a key: Reset the corresponding Button’s background color to the Button’s default background color When the user selects the Color... menu item: Display the Color dialog Update the TextBox text’s color 21.2 Analyzing the Typing Application

 2009 Pearson Education, Inc. All rights reserved. 13 When the user selects the Font... menu item: Display the Font dialog Update the TextBox text’s font When the user selects the Clear TextBox menu item: Clear the TextBox When the user selects the Invert Colors menu item: Swap the TextBox’s background and foreground colors 21.2 Analyzing the Typing Application

 2009 Pearson Education, Inc. All rights reserved. 14 ■Use an ACE table to convert the pseudocode into Visual Basic (Fig. 21.7). Figure 21.7 | ACE table for the Typing Application. (Part 1 of 2.) Action/Control/Event (ACE) Table for the Typing Application

 2009 Pearson Education, Inc. All rights reserved. 15 Figure 21.7 | ACE table for the Typing Application. (Part 2 of 2.) Action/Control/Event (ACE) Table for the Typing Application (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 16 Coding the KeyDown Event Handler ■Open the template application and add the following lines (Fig. 21.8) to your code. Figure 21.8 | Determining whether the pressed key is a control key, function key or arrow key. Determine whether the pressed key is a control key, function key or arrow key

 2009 Pearson Education, Inc. All rights reserved. 17 ■When a key is pressed, the KeyDown event (Fig. 21.9) is raised. –The sender Object is the GUI component with the focus. –The KeyEventArgs object e contains data for the event. –The KeyCode property specifies which key was pressed. ■The Keys enumeration represents keyboard keys using meaningful names. ■The Char class’s IsControl method determines whether the pressed key is a control character. Coding the KeyDown Event Handler (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 18 Figure 21.9 | Method IsFunctionOrArrowKey provided in the template. Coding the KeyDown Event Handler (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 19 ■Visual Basic infers the type of variable from the result of the LINQ expression (lines 15–21 of Fig ). Figure | Using LINQ to locate the Button that matches the pressed key. ■The TypeOf...Is expression determines whether currentControl is of the type Button. Coding the KeyDown Event Handler (Cont.) Using LINQ to Objects to query the Form’s Controls collection and locate the Button that matches the pressed key

 2009 Pearson Education, Inc. All rights reserved. 20 ■A Dictionary collection is used to map the KeyCode of the pressed key to the Text of a Button in the GUI. –A Dictionary is a collection of key/value pairs. –The template code for this application includes a predefined keyDictionary that maps various keys to their Button s. ■The Form ’s Load event handler (Fig ) uses Dictionary method Add to insert key/value pairs. Coding the KeyDown Event Handler (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 21 Figure | Adding key/value pairs to the keyDictionary. Coding the KeyDown Event Handler (Cont.) Adding key/value pairs to the keyDictionary to represent the function keys Adding key/value pairs to the keyDictionary to represent the control and arrow keys

 2009 Pearson Education, Inc. All rights reserved. 22 ■The LINQ expression’s Where clause uses the ContainsKey method to check for the key’s String. ■The CType operator converts the variable’s type (in this case, from Control to Button ). ■Line 21 (Fig ) determines whether the collection returned by the LINQ expression contains any elements. Coding the KeyDown Event Handler (Cont.) Figure | Changing the color of the Button that corresponds to the pressed key. If there is a Button that matches the pressed key, change the Button’s background color

 2009 Pearson Education, Inc. All rights reserved. 23 ■Add the KeyPress event handler to outputTextBox (Fig ). Figure | Determining the Button that matches the pressed key. Coding to the KeyPress Event Handler Using LINQ to Objects to query the Form’s Controls collection and locate the Button that matches the pressed key ■Variable e referes to a KeyPressEventArgs object. ■Property KeyChar represents the character on the key that was pressed. ■ ToUpper returns the String in uppercase.

 2009 Pearson Education, Inc. All rights reserved. 24 ■If the KeyChar contains a space, the space bar was pressed and ChangeColor with spaceButton as an argument (Fig ). Figure | Changing the color of the Button that corresponds to the pressed key. If the KeyChar is a space, change the background color of the Button that represents the space bar Coding to the KeyPress Event Handler (Cont.) If there is a Button that matches the pressed key, change the Button’s background color

 2009 Pearson Education, Inc. All rights reserved. 25 ■Control keys, such as F1, do not raise the KeyPress event. ■The KeyPress event cannot test for the modifier keys (Ctrl, Shift and Alt). ■The KeyUp event is raised when a key is released, regardless of whether the key press is handled by the KeyPress or the KeyDown event handler. Coding to the KeyPress Event Handler (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 26 Software Design Tip Use the KeyPress event handler for letter and number key events. Use the KeyDown event handler for modifier and control key events.

 2009 Pearson Education, Inc. All rights reserved. 27 ■To generate KeyUp, KeyDown or KeyPress event handlers for controls (Fig ): Creating the KeyUp Event Handler Figure | Generating the KeyUp event handler. Class Name ComboBox Method Name ComboBox drop-down list

 2009 Pearson Education, Inc. All rights reserved. 28 ■The KeyUp event handler (Fig ) executes whenever a key is released/ ■Change the color of the released Button back to that Button ’s default color. Figure | Resetting a Button ’s color when its key is released. Resetting a Button’s color after a key is released Creating the KeyUp Event Handler (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 29 ■The IsNot operator can compare a reference type variable’s value to the value Nothing. –The condition evaluates to True if the variable refers to an object. ■You can also use IsNot to compare two reference type variables to determine whether or not they refer to the same object IsNot Operator

 2009 Pearson Education, Inc. All rights reserved. 30 Figure | IsNot operator inside the ResetColor method 21.4 IsNot Operator (Cont.) ■The ResetColor method (Fig 21.17) restores the color of a Button when the corresponding key is released.

 2009 Pearson Education, Inc. All rights reserved. 31 ■Menus allow you to group related commands for Windows applications. ■Although most menus and commands vary among applications, some—such as Open and Save — are common to many applications. ■Menus are an important part of GUIs because they organize commands without cluttering the GUI Menus

 2009 Pearson Education, Inc. All rights reserved. 32 ■Add a MenuStrip from the Menus & Toolbars tab of the Toolbox. ■A box appears on the top of your Form representing a menu item (Fig ). Creating a Menu Figure | MenuStrip control added to the Typing application. MenuStrip control in the component tray ToolStripMenuItem field

 2009 Pearson Education, Inc. All rights reserved. 33 ■Click the icon in the component tray or the menu on the Form to enter Menu Designer. ■Change the Name property of the MenuStrip control to menuBar. ■Type &Display into the Type Here box and press Enter. ■Change the Name of the ToolstripMenuItem to displayMenuItem. ■Two more fields appear (Fig ). Creating a Menu (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 34 Figure | Creating the Display menu. Creating a Menu (Cont.) Menu item

 2009 Pearson Education, Inc. All rights reserved. 35 Good Programming Practice We suggest appending the MenuItem suffix to ToolStripMenuItem controls.

 2009 Pearson Education, Inc. All rights reserved. 36 GUI Design Tip Use book-title capitalization in menu-item text.

 2009 Pearson Education, Inc. All rights reserved. 37 ■In the box below the Display menu, type &Clear TextBox and name this menu item clearMenuItem (Fig ). ■Entering text in the right box turns the menu item on the left into a submenu. ■Type &Invert Colors below the last MenuItem and name this invertMenuItem. Creating a Menu (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 38 Figure | Adding items to the menu. Creating a Menu (Cont.) Submenu Submenu item

 2009 Pearson Education, Inc. All rights reserved. 39 ■Click the small arrow on the right side of the Type Here box. –Select Separator from the drop-down list (Fig ). Creating a Menu (Cont.) Click down arrow to display drop-down list Select Separator to insert a separator bar Figure | Adding a separator bar to group menu items.

 2009 Pearson Education, Inc. All rights reserved. 40 GUI Design Tip Use separator bars in a menu to group related menu items.

 2009 Pearson Education, Inc. All rights reserved. 41 ■In the box under the separator bar, type &Text and name this textMenuItem. –Insert &Color... and &Font... as menu items in the Text submenu. –Name them colorMenuItem and fontMenuItem, respectively (Fig ). Creating a Menu (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 42 Figure | Adding a submenu to a menu item. Creating a Menu (Cont.) Separator bar

 2009 Pearson Education, Inc. All rights reserved. 43 GUI Design Tip If clicking a menu item opens a dialog, an ellipsis ( … ) should follow the menu item’s text.

 2009 Pearson Education, Inc. All rights reserved. 44 ■Double click the Font... menu item that you created to generate its Click event handler (Fig ). Figure | Declarations for the FontDialog and its DialogResult. Declaration for the FontDialog and its result Coding the Font... Menu Item’s Click Event Handler

 2009 Pearson Education, Inc. All rights reserved. 45 ■These lines (Fig ) call the ShowDialog method to display the Font dialog to the user. ■The return value of ShowDialog is assigned to variable result. Figure | Opening the Font dialog. Showing the dialog and assigning the result Coding the Font... Menu Item’s Click Event Handler (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 46 ■These lines (Fig ) determine whether the user has clicked the Font dialog’s Cancel Button. –The value stored in result is compared to the enumeration value DialogResult.Cancel. –If the user clicks the Cancel Button, no action takes place and the method exits. Coding the Font... Menu Item’s Click Event Handler (Cont.) Take no action if user cancels Figure | Exit the event handler if the user clicks Cancel.

 2009 Pearson Education, Inc. All rights reserved. 47 ■Lines 128–129 of Fig give the text the style that the user has selected from the FontDialog. Figure | Changing the display font. Assigning the new font value Coding the Font... Menu Item’s Click Event Handler (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 48 ■Double click the Color... menu item to generate its Click event handler (Fig ). Figure | Declarations for the Color dialog and its DialogResult. Declarations for the ColorDialog and its result Coding the Color... Menu Item’s Click Event Handler

 2009 Pearson Education, Inc. All rights reserved. 49 ■To display the Color dialog as in the completed application, the FullOpen option must be set to True (line 139 of Fig ). Figure | Displaying the Color dialog. Displaying the ColorDialog with a complete color selection Coding the Color... Menu Item’s Click Event Handler (Cont.)

 2009 Pearson Education, Inc. All rights reserved. 50 ■This If...Then statement (Fig ) prevents the color from being changed if the user clicks Cancel. Figure | Changing the display text’s color. Take no action if user cancels Coding the Color... Menu Item’s Click Event Handler (Cont.) Change text color in the TextBox

 2009 Pearson Education, Inc. All rights reserved. 51 ■Double click the Clear TextBox menu item to generate its Click event (Fig ). Figure | Calling the Clear method of class TextBox to erase the text. Clearing the TextBox

 2009 Pearson Education, Inc. All rights reserved. 52 ■Double click the Invert Colors menu item in Design view to create its Click event handler (Fig ). Figure | Empty event handler for Invert Color menu item. Inverting Colors

 2009 Pearson Education, Inc. All rights reserved. 53 ■To swap colors, you must use a temporary Color variable to hold one of the colors that you want to swap (Fig ). Figure | Swapping the background and foreground colors. Inverting Colors (Cont.) Using a temporary variable to swap color values

 2009 Pearson Education, Inc. All rights reserved. 54 ■Figure presents the source code for the Typing application. Outline (1 of 10 ) Converting a KeyCode to a Char using Convert.ToChar Instance variable to store which Button the user pressed

 2009 Pearson Education, Inc. All rights reserved. 55 Outline (2 of 10 ) Determining if the key pressed is a control character Converting a Control to a Button using CType Determining if the Dictionary contains a key matching the KeyCode’s String representation Determining a Control’s type using TypeOf

 2009 Pearson Education, Inc. All rights reserved. 56 Outline (3 of 10 )

 2009 Pearson Education, Inc. All rights reserved. 57 Outline (4 of 10 ) Using the IsNot operator to determine whether lastButton refers to Nothing

 2009 Pearson Education, Inc. All rights reserved. 58 Outline (5 of 10 )

 2009 Pearson Education, Inc. All rights reserved. 59 Outline (6 of 10 ) Adding items to a Dictionary

 2009 Pearson Education, Inc. All rights reserved. 60 Outline (7 of 10 ) Create FontDialog and DialogResult variables

 2009 Pearson Education, Inc. All rights reserved. 61 Outline (8 of 10 ) Display dialog and get Button clicked to exit the dialog Change the text’s font to the value the user selected

 2009 Pearson Education, Inc. All rights reserved. 62 Outline (9 of 10 ) Show all color options in the dialog Display dialog and get Button clicked to exit the dialog Change the text’s color to the value the user selected

 2009 Pearson Education, Inc. All rights reserved. 63 Outline (10 of 10 ) Swap text color and background color