Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design.

Slides:



Advertisements
Similar presentations
Using Macros and Visual Basic for Applications (VBA) with Excel
Advertisements

Chapter 5 Multitable Forms
Creating a Document with a Table, Chart, and Watermark
© by Pearson Education, Inc. All Rights Reserved.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Excel Project 1 Creating a Worksheet and an Embedded Chart.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Project 1 Creating and Editing a Word Document.
Creating, Formatting, and Editing a Word Document with a Picture
1 Introduction to the Visual Studio.NET IDE Powerpoint slides modified from Deitel & Deitel.
Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Word Project 8 Working with Macros and Visual Basic for Applications (VBA)
Module 3 Productivity Programs Common Features and Commands Microsoft Office 2007.
Spreadsheet. Objectives Create a new blank workbook. Create a new blank workbook. Identify user interface elements that you can use to accomplish basic.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 4 Reports, Forms, and Combo Boxes.
Microsoft Office 2010 Office 2010 and Windows 7: Essential Concepts and Skills.
Microsoft Visual Basic 2012 CHAPTER TWO Program and Graphical User Interface Design.
Microsoft Visual Basic 2012 CHAPTER TWELVE (ENRICHMENT CHAPTER) Windows Store Apps.
Microsoft Word 2010 Chapter 1 Creating, Formatting, and Editing a Word Document with Pictures.
Office 2013 and Windows 8: Essential Concepts and Skills
Chapter 2 Creating a Research Paper with References and Sources Microsoft Word 2013.
Using Form Tools and Creating Custom Forms Microsoft Access 2010.
IE 411/511: Visual Programming for Industrial Applications
Microsoft Office 2007 Excel Graphics Feature SmartArt and Images.
Office 2013 and Windows 8: Essential Concepts and Skills Microsoft Access 2013.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 2 The Visual Basic.NET Integrated Development Environment.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
XP New Perspectives on Windows XP Tutorial 1 Exploring the Basics.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Project 1 Creating and Editing a Word Document.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 5 Enhancing Forms with OLE Fields, Hyperlinks, and Subforms.
Program Design and Coding
Microsoft Visual Basic 2012 CHAPTER THREE Program Design and Coding.
Microsoft Visual Basic 2010 CHAPTER THREE Program Design and Coding.
Dreamweaver CS4 Concepts and Techniques Chapter 2 Adding Web Pages, Links, and Images.
Microsoft Access 2010 Chapter 8 Advanced Form Techniques.
Visual Basic 2005 CHAPTER 2 Program and Graphical User Interface Design.
MODULE 2 Microsoft® Windows 7 Chapter 1: Navigating around Windows Chapter 2: Managing Files and Folders Chapter 3: Working with Windows Settings, Gadgets,
Microsoft Publisher 2010 Chapter 1 Creating a Flyer.
Chapter 2 – Introduction to the Visual Studio .NET IDE
Chapter 4 Working with Information Graphics
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
Microsoft Office 2010 is the newest version of Microsoft Office, offering features that provide users with better functionality and easier ways to work.
 2002 Prentice Hall. All rights reserved. 1 Chapter 2 – Introduction to the Visual Studio.NET IDE Outline 2.1Introduction 2.2Visual Studio.NET Integrated.
Office 2013 and Windows 8: Essential Concepts and Skills Microsoft Office 2013.
1 After completing this lesson, you will be able to: Open a file. Navigate through a document. Scroll through a document. Insert text in a document. Select.
1 After completing this lesson, you will be able to: Create a form using AutoForm. Create a form using the Form Wizard. Add controls to a form. Modify.
Chapter 3 I Need a Tour Guide (Introduction to Visual Basic 2010) Clearly Visual Basic: Programming with Visual Basic nd Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 3 Building an Application in the Visual Basic.NET Environment.
XP IT INSTRUCTOR :AHMAD HIRZALLAH 1 Microsoft Office FrontPage 2003 Creating Tables and Frames.
IE 411/511: Visual Programming for Industrial Applications Lecture Notes #2 Introduction to the Visual Basic Express 2010 Integrated Development Environment.
Chapter 5 Working with Multiple Worksheets and Workbooks Microsoft Excel 2013.
 2002 Prentice Hall. All rights reserved. 1 Introduction to the Visual Studio.NET IDE Outline Introduction Visual Studio.NET Integrated Development Environment.
MS WORD INFORMATION TECHNOLOGY MANAGEMENT SERVICE Training & Research Division.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 6 Looping and Multiple Forms.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Office 2013 and Windows 8: Essential Concepts and Skills Microsoft Office 2013.
PowerPoint Chapter 1 Creating and Editing a Presentation with Clip Art Discovering Computers & Microsoft Office 2010.
Lesson1 WORD BCOMP0101 Introduction to Information Technology Noris Bt. Ismail Faculty of Information and Communication Technology Tel :
 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.
XP New Perspectives on Microsoft Office FrontPage 2003 Tutorial 5 1 Microsoft Office FrontPage 2003 Tutorial 5 – Creating Tables and Frames.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 11 Creating Web Applications and Writing Data to a Database.
Fundamentals of Windows Mouse n 4 Basic Operations: –Pointing –Clicking –Double Clicking –Dragging.
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
Chapter 2 – Introduction to the Visual Studio .NET IDE
Program and Graphical User Interface Design
Program and Graphical User Interface Design
CIS16 Application Programming with Visual Basic
Chapter 2 – Introduction to the Visual Studio .NET IDE
Windows xp PART 1 DR.WAFAA SHRIEF.
Presentation transcript:

Microsoft Visual Basic 2010 CHAPTER TWO Program and Graphical User Interface Design

2 Chapter 2: Program and Graphical User Interface Design2 Objectives ►Open and close Visual Studio 2010 ►Create a Visual Basic 2010 Windows Application project ►Name and set the Title Bar text in a Windows Form object; resize a Windows Form object ►Add a Label object to a Windows Form object; name the Label object; set the text in the Label object; change the Font properties of the text in the Label object ►Add a PictureBox object to the Windows Form object; name the PictureBox object; resize the PictureBox object

2 Chapter 2: Program and Graphical User Interface Design3 Objectives ►Add a Button object to the Windows Form object; name the Button object; set the text in the Button object; change the Button object size ►Align Objects on the Windows Form object ►Save and open Visual Basic projects ►Understand and implement graphical user interface design principles ►Understand and implement the first two phases of the program development life cycle

2 Preview the Chapter Project Chapter 2: Program and Graphical User Interface Design4

2 5 Open Visual Studio 2010 ►Click the Start button on the Windows taskbar, point to All Programs on the Start menu, and then point to Microsoft Visual Studio 2010 on the All Programs submenu ►Click Microsoft Visual Studio 2010 on the submenu

2 Chapter 2: Program and Graphical User Interface Design6 Open Visual Studio 2010

2 Chapter 2: Program and Graphical User Interface Design7

2 8 Create a New Visual Basic 2010 Windows Application Project ►Click the New Project button on the Standard toolbar ►If necessary, in the left pane, click Visual Basic so it is selected ►If necessary, click Windows Forms Application in the middle pane ►Double-click the text,WindowsApplication1, in the Name text box to select the text. Type the project name ►Click the OK button in the New Project window

2 Chapter 2: Program and Graphical User Interface Design9 Create a New Visual Basic 2010 Windows Application Project

2 Chapter 2: Program and Graphical User Interface Design10

2 Display the Toolbox ►If the window does not already display the Toolbox, point to the Toolbox button in the left margin of the window Chapter 2: Program and Graphical User Interface Design11

2 Display the Toolbox Chapter 2: Program and Graphical User Interface Design12

2 Permanently Display the Toolbox ►If necessary, point to the Toolbox button in the left margin of the window to display the Toolbox. Then, click the Auto Hide button on the Toolbox title bar Chapter 2: Program and Graphical User Interface Design13

2 Permanently Display the Toolbox Chapter 2: Program and Graphical User Interface Design14

2 Chapter 2: Program and Graphical User Interface Design15 Name the Windows Form Object ►Click anywhere in the Windows Form object to select it ►In the Solution Explorer window, right-click the Form1.vb filename. On the shortcut menu, point to Rename ►Click Rename. Type the name of the form, and press the ENTER key

2 Name the Windows Form Object Chapter 2: Program and Graphical User Interface Design16

2 Name the Windows Form Object Chapter 2: Program and Graphical User Interface Design17

2 Chapter 2: Program and Graphical User Interface Design18 Set the Title Bar Text in a Windows Form Object ►With the Windows Form object selected, scroll in the Properties window until you find the Text property. Then, double-click in the right column for the Text property ►Type the title bar text, and then press the ENTER key

2 Chapter 2: Program and Graphical User Interface Design19 Set the Title Bar Text in a Windows Form Object

2 Chapter 2: Program and Graphical User Interface Design20

2 Chapter 2: Program and Graphical User Interface Design21 Resize a Form ►Place the mouse pointer over the sizing handle in the lower-right corner of the Windows Form object ►Drag the sizing handle to the right and down until the window is the size you want. Then, release the left mouse button

2 Resize a Form Chapter 2: Program and Graphical User Interface Design22

2 Chapter 2: Program and Graphical User Interface Design23 Add a Label Object ►Drag the Label.NET component button from the Common Controls category in the Toolbox over the Windows Form object to the approximate location where you want to place the Label object ►When the mouse pointer is in the correct location, release the left mouse button

2 Add a Label Object Chapter 2: Program and Graphical User Interface Design24

2 Chapter 2: Program and Graphical User Interface Design25 Name the Label Object ►With the Label object selected, scroll in the Properties window until you find the (Name) property. Then double-click in the right column for the (Name) property ►Type the new name, and then press the ENTER key

2 Name the Label Object Chapter 2: Program and Graphical User Interface Design26

2 Chapter 2: Program and Graphical User Interface Design27 Change the Text in a Label Object ►With the Label object selected, scroll in the Properties dialog box until you find the Text property. Then, double-click the Text value in the right column ►Type the new text for the Text property ►To enter the Text property, press the ENTER key

2 Chapter 2: Program and Graphical User Interface Design28 Change the Text in a Label Object

2 Chapter 2: Program and Graphical User Interface Design29

2 Chapter 2: Program and Graphical User Interface Design30 Enter Multiple Lines of Text in a Label Object ►With the Label object selected, click the Text property name in the left column of the Properties window. Then, click the down arrow in the right column of the Text property

2 Enter Multiple Lines of Text in a Label Object Chapter 2: Program and Graphical User Interface Design31

2 Chapter 2: Program and Graphical User Interface Design32 Change Label Font, Font Style, and Font Size ►Click the Label object to select it. Scroll until you find the Font property in the Properties window. Click the Font property in the left column of the Label property window ►Click the ellipsis button for the Font property ►In the Font dialog box, scroll to the font you want to use in the Font list and then click the font in the Font list. Click a desired font style in the Font style list. Click the size you want to use in the Size list ►Click the OK button

2 Chapter 2: Program and Graphical User Interface Design33 Change Label Font, Font Style, and Font Size

2 Chapter 2: Program and Graphical User Interface Design34

2 Chapter 2: Program and Graphical User Interface Design35 Center a Label Object in the Windows Form Object ►With the Label object selected, click Format on the Menu bar and then point to Center in Form on the Format menu ►Click Horizontally on the Center in Form submenu

2 Center a Label Object in the Windows Form Object Chapter 2: Program and Graphical User Interface Design36

2 Chapter 2: Program and Graphical User Interface Design37 Delete GUI Objects ►Select the object to be deleted by clicking it ►Press the DELETE key on the keyboard

2 Delete GUI Objects Chapter 2: Program and Graphical User Interface Design38

2 Chapter 2: Program and Graphical User Interface Design39 Use the Undo Button on the Standard Toolbar ►Click the Undo button on the Standard toolbar

2 Use the Undo Button on the Standard Toolbar Chapter 2: Program and Graphical User Interface Design40

2 Chapter 2: Program and Graphical User Interface Design41 Add a PictureBox Object ►With the Toolbox visible, drag the PictureBox.NET component on the Toolbox over the Windows Form object to the approximate location where you want the PictureBox object to be displayed ►When the mouse pointer is in the correct location, release the left mouse button

2 Chapter 2: Program and Graphical User Interface Design42 Add a PictureBox Object

2 Chapter 2: Program and Graphical User Interface Design43

2 Chapter 2: Program and Graphical User Interface Design44 Name a PictureBox Object ►Select the PictureBox object ►Locate the (Name) property in the Properties window for the PictureBox object ►Double-click the value in the right column for the (Name) property, type the name, and then press the ENTER key

2 Chapter 2: Program and Graphical User Interface Design45 Resize a PictureBox Object ►Place the mouse pointer over the sizing handle at the lower-right corner of the PictureBox object, and then drag the handle to the size required

2 Resize a PictureBox Object Chapter 2: Program and Graphical User Interface Design46

2 Chapter 2: Program and Graphical User Interface Design47 Add a Second PictureBox Object ►Drag the PictureBox.NET component in the Toolbox to any location in the Windows Form object, and then release the left mouse button

2 Add a Second PictureBox Object Chapter 2: Program and Graphical User Interface Design48

2 Chapter 2: Program and Graphical User Interface Design49 Make Objects the Same Size ►Select the object whose size you want to duplicate, and then hold down the CTRL key and click the object you want to resize ►Click Format on the menu bar and then point to the Make Same Size command on the Format menu ►Click Both on the Make Same Size submenu

2 Chapter 2: Program and Graphical User Interface Design50 Make Objects the Same Size

2 Chapter 2: Program and Graphical User Interface Design51

2 Chapter 2: Program and Graphical User Interface Design52 Align the PictureBox Objects ►With the left and right PictureBox objects selected, click Format on the menu bar and then point to Align on the Format menu ►Click Bottoms on the Align submenu

2 Align the PictureBox Objects Chapter 2: Program and Graphical User Interface Design53

2 Chapter 2: Program and Graphical User Interface Design54 Center Multiple Objects Horizontally in the Window ►With both objects selected, click Format on the menu bar and then point to the Center in Form command ►Click Horizontally on the Center in Form submenu

2 Center Multiple Objects Horizontally in the Window Chapter 2: Program and Graphical User Interface Design55

2 Chapter 2: Program and Graphical User Interface Design56 Add a Button Object ►With the Toolbox displayed in the Visual Studio window, drag the Button.NET component in the Toolbox over the Windows Form object to the position where you want to place the button ►When the mouse pointer is positioned properly, release the left mouse button

2 Add a Button Object Chapter 2: Program and Graphical User Interface Design57

2 Chapter 2: Program and Graphical User Interface Design58 Name and Set Text for a Button Object ►With the Button object selected, scroll in the Properties dialog box until you find the Text property. Double-click the Text value in the right column, type the text you want to display, and then press the ENTER key

2 Name and Set Text for a Button Object Chapter 2: Program and Graphical User Interface Design59

2 Chapter 2: Program and Graphical User Interface Design60 Change Button Object Size ►Place the mouse pointer over the right edge of the Button object until the pointer changes to a double-headed arrow ►Drag the mouse pointer to the right until the Button object is just big enough to display the text, and then release the left mouse button

2 Change Button Object Size Chapter 2: Program and Graphical User Interface Design61

2 Chapter 2: Program and Graphical User Interface Design62 Add and Align a Second Button ►Drag the Button.NET component from the Toolbox to the right of the Standard Room button on the Windows Form object. Align the top of the rectangle in the mouse pointer to the top of the Standard Room button until a blue line displays along the tops of the buttons ►When the buttons are aligned and spaced as you like, release the left mouse button

2 Chapter 2: Program and Graphical User Interface Design63 Add and Align a Second Button

2 Chapter 2: Program and Graphical User Interface Design64

2 Chapter 2: Program and Graphical User Interface Design65 Aligning Objects Vertically ►If necessary, click anywhere in the Windows Form object to deselect any other objects. Then, slowly drag the Deluxe Room button below the Standard Room button until vertical blue snap lines are displayed ►When the blue lines appear, indicating the buttons are aligned vertically, drag the Deluxe Room button up or down to create the proper spacing between the buttons, and then release the left mouse button

2 Chapter 2: Program and Graphical User Interface Design66 Aligning Objects Vertically

2 Chapter 2: Program and Graphical User Interface Design67

2 Chapter 2: Program and Graphical User Interface Design68 Save a Visual Basic Project ►To save the work you have completed, you can click the Save All button on the Standard toolbar ►The first time you save a project, the Save Project dialog box is displayed

2 Chapter 2: Program and Graphical User Interface Design69 Close Visual Studio 2010 ►To close Visual Studio, you can click the Close button on the right of the Visual Studio window title bar ►If, when you close Visual Studio, you have never saved your program, Visual Studio will display the Close Project dialog box

2 Chapter 2: Program and Graphical User Interface Design70 Open a Visual Studio Project ►Method 1: Double-click the solution file in the folder in which it is stored ►Method 2: With Visual Studio open, click the Open File button on the Standard toolbar, locate the solution file, and open it ►Method 3: With Visual Studio open, click File on the menu bar and then point to Recent Projects and Solutions on the File menu. Click the name of the project you want to open

2 Chapter 2: Program and Graphical User Interface Design71 Program Development Life Cycle ►Set of phases and steps that are followed by developers to design, create, and maintain a computer program Gather and Analyze the Program Requirements Design the User Interface Design the Program Processing Objects Code the Program Test the Program Document the Program/System Maintain the Program/System

2 Chapter 2: Program and Graphical User Interface Design72 Phase I: Gather and Analyze the Program Requirements ►Gather project requirements by interviewing users, reviewing current procedures, and completing other fact-gathering tasks ►Two types of requirements documentation Requirements document Use Case Definition

2 Phase I: Gather and Analyze the Program Requirements Chapter 2: Program and Graphical User Interface Design73

2 Phase I: Gather and Analyze the Program Requirements Chapter 2: Program and Graphical User Interface Design74

2 Chapter 2: Program and Graphical User Interface Design75 Phase 2: Design the User Interface ►Developers sometimes spend 25% to 40% of the program design time on the user interface Presentation layer ►Use Visual Studio to create the user interface ►Interface designs are often called mock-ups

2 Chapter 2: Program and Graphical User Interface Design76 Phase 2: Design the User Interface ►Principles of User Interface Design The GUI should be easy to use and follow ►Users will not be satisfied with the application if the user interface is not easy to use Three primary means of interacting in a user interface are the keyboard, a pointing device, and voice input Use of the interface should feel natural and normal Provide the most appropriate object for each requirement

2 Chapter 2: Program and Graphical User Interface Design77 Phase 2: Design the User Interface Once an object is used for a particular purpose, then that object should be used for the same purpose throughout the program interface Arrange objects in the sequence in which they are used The interface should be kept as simple as possible, while maintaining functionality The user interface should be intuitive

2 Chapter 2: Program and Graphical User Interface Design78 Summary ►Open and close Visual Studio 2010 ►Create a Visual Basic 2010 Windows Application project ►Name and set the Title Bar text in a Windows Form object; resize a Windows Form object ►Add a Label object to a Windows Form object; name the Label object; set the text in the Label object; change the Font properties of the text in the Label object ►Add a PictureBox object to the Windows Form object; name the PictureBox object; resize the PictureBox object

2 Chapter 2: Program and Graphical User Interface Design79 Summary ►Add a Button object to the Windows Form object; name the Button object; set the text in the Button object; change the Button object size ►Align Objects on the Windows Form object ►Save and open Visual Basic projects ►Understand and implement graphical user interface design principles ►Understand and implement the first two phases of the program development life cycle

Microsoft Visual Basic 2010 CHAPTER TWO COMPLETE Program and Graphical User Interface Design