SlideShare una empresa de Scribd logo
1 de 53
Descargar para leer sin conexión
CHAPTER TWO Program and GraphicalUser Interface Design
Chapter 2: Program and Graphical User Interface Design 2 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
Chapter 2: Program and Graphical User Interface Design 3 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
Chapter 2: Program and Graphical User Interface Design 4 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
Chapter 2: Program and Graphical User Interface Design 5 Open Visual Studio 2010
Chapter 2: Program and Graphical User Interface Design 6 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
Chapter 2: Program and Graphical User Interface Design 7 Create a New Visual Basic 2010Windows Application Project
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 Design 8
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 Design 9
Chapter 2: Program and Graphical User Interface Design 10 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
Name the Windows Form Object Chapter 2: Program and Graphical User Interface Design 11
Chapter 2: Program and Graphical User Interface Design 12 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
Chapter 2: Program and Graphical User Interface Design 13 Set the Title Bar Text in a Windows Form Object
Chapter 2: Program and Graphical User Interface Design 14 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
Chapter 2: Program and Graphical User Interface Design 15 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
Chapter 2: Program and Graphical User Interface Design 16 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
Chapter 2: Program and Graphical User Interface Design 17 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
Chapter 2: Program and Graphical User Interface Design 18 Change the Text in a Label Object
Chapter 2: Program and Graphical User Interface Design 19 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
Chapter 2: Program and Graphical User Interface Design 20 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
Chapter 2: Program and Graphical User Interface Design 21 Change Label Font, Font Style, and Font Size
Chapter 2: Program and Graphical User Interface Design 22 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
Chapter 2: Program and Graphical User Interface Design 23 Delete GUI Objects Select the object to be deleted by clicking it Press the DELETE key on the keyboard
Chapter 2: Program and Graphical User Interface Design 24 Use the Undo Button on the Standard Toolbar Click the Undo button on the Standard toolbar
Chapter 2: Program and Graphical User Interface Design 25 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
Chapter 2: Program and Graphical User Interface Design 26 Add a PictureBox Object
Chapter 2: Program and Graphical User Interface Design 27 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
Chapter 2: Program and Graphical User Interface Design 28 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
Chapter 2: Program and Graphical User Interface Design 29 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
Chapter 2: Program and Graphical User Interface Design 30 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
Chapter 2: Program and Graphical User Interface Design 31 Make Objects the Same Size
Chapter 2: Program and Graphical User Interface Design 32 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
Chapter 2: Program and Graphical User Interface Design 33 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
Chapter 2: Program and Graphical User Interface Design 34 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
Chapter 2: Program and Graphical User Interface Design 35 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
Chapter 2: Program and Graphical User Interface Design 36 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
Chapter 2: Program and Graphical User Interface Design 37 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
Chapter 2: Program and Graphical User Interface Design 38 Add and Align a Second Button
Chapter 2: Program and Graphical User Interface Design 39 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
Chapter 2: Program and Graphical User Interface Design 40 Aligning Objects Vertically
Chapter 2: Program and Graphical User Interface Design 41 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
Chapter 2: Program and Graphical User Interface Design 42 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
Chapter 2: Program and Graphical User Interface Design 43 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
Chapter 2: Program and Graphical User Interface Design 44 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
Chapter 2: Program and Graphical User Interface Design 45 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
Phase I: Gather and Analyze the Program Requirements Chapter 2: Program and Graphical User Interface Design 46
Phase I: Gather and Analyze the Program Requirements Chapter 2: Program and Graphical User Interface Design 47
Chapter 2: Program and Graphical User Interface Design 48 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
Chapter 2: Program and Graphical User Interface Design 49 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
Chapter 2: Program and Graphical User Interface Design 50 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
Chapter 2: Program and Graphical User Interface Design 51 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
Chapter 2: Program and Graphical User Interface Design 52 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
CHAPTER TWO COMPLETE Program and GraphicalUser Interface Design

Más contenido relacionado

La actualidad más candente

Photoshop notes cs-4
Photoshop notes  cs-4Photoshop notes  cs-4
Photoshop notes cs-4SirajRock
 
Access Ch5 Multi Table Forms (Jy)
Access Ch5   Multi Table Forms (Jy)Access Ch5   Multi Table Forms (Jy)
Access Ch5 Multi Table Forms (Jy)Chun Hoi Lam
 
Nota bm topik10 oumh1103
Nota bm topik10 oumh1103Nota bm topik10 oumh1103
Nota bm topik10 oumh1103azman_awan9
 
WP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightWP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightMICTT Palma
 
Microsft excel 2007 ( ict )
Microsft excel 2007 ( ict )Microsft excel 2007 ( ict )
Microsft excel 2007 ( ict )Nisrina Khalilah
 
Autocad 2015-what-is-new-guide
Autocad 2015-what-is-new-guideAutocad 2015-what-is-new-guide
Autocad 2015-what-is-new-guideleninvry
 
Presentation On Coral Draw By Batra Computer Centre
Presentation On Coral Draw By Batra Computer CentrePresentation On Coral Draw By Batra Computer Centre
Presentation On Coral Draw By Batra Computer CentreBatra Computer Centre
 
Basic Computer Works for BBA students
Basic Computer Works for BBA studentsBasic Computer Works for BBA students
Basic Computer Works for BBA studentsAnkit Gupta
 

La actualidad más candente (13)

01 Introduction
01 Introduction01 Introduction
01 Introduction
 
Word chapter 3
Word chapter 3Word chapter 3
Word chapter 3
 
Photoshop notes cs-4
Photoshop notes  cs-4Photoshop notes  cs-4
Photoshop notes cs-4
 
Access Ch5 Multi Table Forms (Jy)
Access Ch5   Multi Table Forms (Jy)Access Ch5   Multi Table Forms (Jy)
Access Ch5 Multi Table Forms (Jy)
 
Nota bm topik10 oumh1103
Nota bm topik10 oumh1103Nota bm topik10 oumh1103
Nota bm topik10 oumh1103
 
WP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a SilverlightWP7 HUB_Introducción a Silverlight
WP7 HUB_Introducción a Silverlight
 
Access chapter 1
Access chapter 1Access chapter 1
Access chapter 1
 
Ms access
Ms accessMs access
Ms access
 
Chapter.11
Chapter.11Chapter.11
Chapter.11
 
Microsft excel 2007 ( ict )
Microsft excel 2007 ( ict )Microsft excel 2007 ( ict )
Microsft excel 2007 ( ict )
 
Autocad 2015-what-is-new-guide
Autocad 2015-what-is-new-guideAutocad 2015-what-is-new-guide
Autocad 2015-what-is-new-guide
 
Presentation On Coral Draw By Batra Computer Centre
Presentation On Coral Draw By Batra Computer CentrePresentation On Coral Draw By Batra Computer Centre
Presentation On Coral Draw By Batra Computer Centre
 
Basic Computer Works for BBA students
Basic Computer Works for BBA studentsBasic Computer Works for BBA students
Basic Computer Works for BBA students
 

Destacado

Chapter 03
Chapter 03Chapter 03
Chapter 03llmeade
 
Chapter 04
Chapter 04Chapter 04
Chapter 04llmeade
 
Chapter 06
Chapter 06Chapter 06
Chapter 06llmeade
 
Chapter 01
Chapter 01Chapter 01
Chapter 01llmeade
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersDave Bost
 
Chapter 05
Chapter 05Chapter 05
Chapter 05llmeade
 
Chapter 08
Chapter 08Chapter 08
Chapter 08llmeade
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Designfrancopw
 
Chapter 3 — Program Design and Coding
Chapter 3 — Program Design and Coding Chapter 3 — Program Design and Coding
Chapter 3 — Program Design and Coding francopw
 
Chapter 4 — Variables and Arithmetic Operations
Chapter 4 — Variables and Arithmetic OperationsChapter 4 — Variables and Arithmetic Operations
Chapter 4 — Variables and Arithmetic Operationsfrancopw
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming francopw
 
Visual Basic Codes And Screen Designs
Visual Basic Codes And Screen DesignsVisual Basic Codes And Screen Designs
Visual Basic Codes And Screen Designsprcastano
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programmingRoger Argarin
 

Destacado (15)

Chapter 03
Chapter 03Chapter 03
Chapter 03
 
Visual Basic –User Interface- V
Visual Basic –User Interface- VVisual Basic –User Interface- V
Visual Basic –User Interface- V
 
Chapter 04
Chapter 04Chapter 04
Chapter 04
 
Chapter 06
Chapter 06Chapter 06
Chapter 06
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for DevelopersMSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
MSDN Presents: Visual Studio 2010, .NET 4, SharePoint 2010 for Developers
 
Chapter 05
Chapter 05Chapter 05
Chapter 05
 
Chapter 08
Chapter 08Chapter 08
Chapter 08
 
Chapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface DesignChapter 2 — Program and Graphical User Interface Design
Chapter 2 — Program and Graphical User Interface Design
 
Chapter 3 — Program Design and Coding
Chapter 3 — Program Design and Coding Chapter 3 — Program Design and Coding
Chapter 3 — Program Design and Coding
 
Chapter 4 — Variables and Arithmetic Operations
Chapter 4 — Variables and Arithmetic OperationsChapter 4 — Variables and Arithmetic Operations
Chapter 4 — Variables and Arithmetic Operations
 
PHP programmimg
PHP programmimgPHP programmimg
PHP programmimg
 
Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming Chapter 1 — Introduction to Visual Basic 2010 Programming
Chapter 1 — Introduction to Visual Basic 2010 Programming
 
Visual Basic Codes And Screen Designs
Visual Basic Codes And Screen DesignsVisual Basic Codes And Screen Designs
Visual Basic Codes And Screen Designs
 
Introduction to visual basic programming
Introduction to visual basic programmingIntroduction to visual basic programming
Introduction to visual basic programming
 

Similar a Chapter 02

Power Point Project 5
Power Point Project 5Power Point Project 5
Power Point Project 5lonetree
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.pptLalRatan
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Designpatf719
 
Adobe Illustrator CS5 Part 2 : Vector Graphic Effects
Adobe Illustrator CS5 Part 2 : Vector Graphic EffectsAdobe Illustrator CS5 Part 2 : Vector Graphic Effects
Adobe Illustrator CS5 Part 2 : Vector Graphic Effectscsula its training
 
COSC 1436 Project Page 1 Pre Project Example Secti.docx
COSC 1436 Project Page 1  Pre Project Example Secti.docxCOSC 1436 Project Page 1  Pre Project Example Secti.docx
COSC 1436 Project Page 1 Pre Project Example Secti.docxfaithxdunce63732
 
Drawing and Selecting Through Line
Drawing and Selecting Through LineDrawing and Selecting Through Line
Drawing and Selecting Through LineSanthiNivas
 
Lines, shapes, docker
Lines, shapes, dockerLines, shapes, docker
Lines, shapes, dockerSanthiNivas
 
Csc153 chapter 03
Csc153 chapter 03Csc153 chapter 03
Csc153 chapter 03PCC
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Jeanie Arnoco
 
Csphtp1 02
Csphtp1 02Csphtp1 02
Csphtp1 02HUST
 
Toolbar, statusbar, coolbar in vb
Toolbar, statusbar, coolbar in vbToolbar, statusbar, coolbar in vb
Toolbar, statusbar, coolbar in vbAmandeep Kaur
 
Adobe Illustrator CC 2018
Adobe Illustrator CC 2018 Adobe Illustrator CC 2018
Adobe Illustrator CC 2018 NYCCTfab
 
Building your first power apps from scratch a step by step walkthrough
Building your first power apps from scratch   a step by step walkthroughBuilding your first power apps from scratch   a step by step walkthrough
Building your first power apps from scratch a step by step walkthroughSanjiv Venkatram
 
Adobe Illustrator CS6 Primer
Adobe Illustrator CS6 PrimerAdobe Illustrator CS6 Primer
Adobe Illustrator CS6 PrimerNYCCTfab
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxAOmaAli
 

Similar a Chapter 02 (20)

Power Point Project 5
Power Point Project 5Power Point Project 5
Power Point Project 5
 
Introduction
IntroductionIntroduction
Introduction
 
Chapter2.ppt
Chapter2.pptChapter2.ppt
Chapter2.ppt
 
Chapter 03 - Program Coding and Design
Chapter 03 - Program Coding and DesignChapter 03 - Program Coding and Design
Chapter 03 - Program Coding and Design
 
Adobe Illustrator CS5 Part 2 : Vector Graphic Effects
Adobe Illustrator CS5 Part 2 : Vector Graphic EffectsAdobe Illustrator CS5 Part 2 : Vector Graphic Effects
Adobe Illustrator CS5 Part 2 : Vector Graphic Effects
 
COSC 1436 Project Page 1 Pre Project Example Secti.docx
COSC 1436 Project Page 1  Pre Project Example Secti.docxCOSC 1436 Project Page 1  Pre Project Example Secti.docx
COSC 1436 Project Page 1 Pre Project Example Secti.docx
 
dr_1
dr_1dr_1
dr_1
 
dr_1
dr_1dr_1
dr_1
 
Drawing and Selecting Through Line
Drawing and Selecting Through LineDrawing and Selecting Through Line
Drawing and Selecting Through Line
 
Lines, shapes, docker
Lines, shapes, dockerLines, shapes, docker
Lines, shapes, docker
 
IndesignFlyer
IndesignFlyerIndesignFlyer
IndesignFlyer
 
Csc153 chapter 03
Csc153 chapter 03Csc153 chapter 03
Csc153 chapter 03
 
Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6Introduction to programming using Visual Basic 6
Introduction to programming using Visual Basic 6
 
Csphtp1 02
Csphtp1 02Csphtp1 02
Csphtp1 02
 
Toolbar, statusbar, coolbar in vb
Toolbar, statusbar, coolbar in vbToolbar, statusbar, coolbar in vb
Toolbar, statusbar, coolbar in vb
 
Adobe Illustrator CC 2018
Adobe Illustrator CC 2018 Adobe Illustrator CC 2018
Adobe Illustrator CC 2018
 
Building your first power apps from scratch a step by step walkthrough
Building your first power apps from scratch   a step by step walkthroughBuilding your first power apps from scratch   a step by step walkthrough
Building your first power apps from scratch a step by step walkthrough
 
Adobe Illustrator CS6 Primer
Adobe Illustrator CS6 PrimerAdobe Illustrator CS6 Primer
Adobe Illustrator CS6 Primer
 
LECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptxLECTURE 12 WINDOWS FORMS PART 2.pptx
LECTURE 12 WINDOWS FORMS PART 2.pptx
 
Vp lecture 11 ararat
Vp lecture 11 araratVp lecture 11 ararat
Vp lecture 11 ararat
 

Chapter 02

  • 1. CHAPTER TWO Program and GraphicalUser Interface Design
  • 2. Chapter 2: Program and Graphical User Interface Design 2 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
  • 3. Chapter 2: Program and Graphical User Interface Design 3 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
  • 4. Chapter 2: Program and Graphical User Interface Design 4 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
  • 5. Chapter 2: Program and Graphical User Interface Design 5 Open Visual Studio 2010
  • 6. Chapter 2: Program and Graphical User Interface Design 6 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
  • 7. Chapter 2: Program and Graphical User Interface Design 7 Create a New Visual Basic 2010Windows Application Project
  • 8. 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 Design 8
  • 9. 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 Design 9
  • 10. Chapter 2: Program and Graphical User Interface Design 10 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
  • 11. Name the Windows Form Object Chapter 2: Program and Graphical User Interface Design 11
  • 12. Chapter 2: Program and Graphical User Interface Design 12 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
  • 13. Chapter 2: Program and Graphical User Interface Design 13 Set the Title Bar Text in a Windows Form Object
  • 14. Chapter 2: Program and Graphical User Interface Design 14 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
  • 15. Chapter 2: Program and Graphical User Interface Design 15 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
  • 16. Chapter 2: Program and Graphical User Interface Design 16 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
  • 17. Chapter 2: Program and Graphical User Interface Design 17 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
  • 18. Chapter 2: Program and Graphical User Interface Design 18 Change the Text in a Label Object
  • 19. Chapter 2: Program and Graphical User Interface Design 19 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
  • 20. Chapter 2: Program and Graphical User Interface Design 20 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
  • 21. Chapter 2: Program and Graphical User Interface Design 21 Change Label Font, Font Style, and Font Size
  • 22. Chapter 2: Program and Graphical User Interface Design 22 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
  • 23. Chapter 2: Program and Graphical User Interface Design 23 Delete GUI Objects Select the object to be deleted by clicking it Press the DELETE key on the keyboard
  • 24. Chapter 2: Program and Graphical User Interface Design 24 Use the Undo Button on the Standard Toolbar Click the Undo button on the Standard toolbar
  • 25. Chapter 2: Program and Graphical User Interface Design 25 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
  • 26. Chapter 2: Program and Graphical User Interface Design 26 Add a PictureBox Object
  • 27. Chapter 2: Program and Graphical User Interface Design 27 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
  • 28. Chapter 2: Program and Graphical User Interface Design 28 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
  • 29. Chapter 2: Program and Graphical User Interface Design 29 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
  • 30. Chapter 2: Program and Graphical User Interface Design 30 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
  • 31. Chapter 2: Program and Graphical User Interface Design 31 Make Objects the Same Size
  • 32. Chapter 2: Program and Graphical User Interface Design 32 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
  • 33. Chapter 2: Program and Graphical User Interface Design 33 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
  • 34. Chapter 2: Program and Graphical User Interface Design 34 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
  • 35. Chapter 2: Program and Graphical User Interface Design 35 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
  • 36. Chapter 2: Program and Graphical User Interface Design 36 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
  • 37. Chapter 2: Program and Graphical User Interface Design 37 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
  • 38. Chapter 2: Program and Graphical User Interface Design 38 Add and Align a Second Button
  • 39. Chapter 2: Program and Graphical User Interface Design 39 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
  • 40. Chapter 2: Program and Graphical User Interface Design 40 Aligning Objects Vertically
  • 41. Chapter 2: Program and Graphical User Interface Design 41 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
  • 42. Chapter 2: Program and Graphical User Interface Design 42 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
  • 43. Chapter 2: Program and Graphical User Interface Design 43 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
  • 44. Chapter 2: Program and Graphical User Interface Design 44 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
  • 45. Chapter 2: Program and Graphical User Interface Design 45 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
  • 46. Phase I: Gather and Analyze the Program Requirements Chapter 2: Program and Graphical User Interface Design 46
  • 47. Phase I: Gather and Analyze the Program Requirements Chapter 2: Program and Graphical User Interface Design 47
  • 48. Chapter 2: Program and Graphical User Interface Design 48 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
  • 49. Chapter 2: Program and Graphical User Interface Design 49 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
  • 50. Chapter 2: Program and Graphical User Interface Design 50 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
  • 51. Chapter 2: Program and Graphical User Interface Design 51 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
  • 52. Chapter 2: Program and Graphical User Interface Design 52 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
  • 53. CHAPTER TWO COMPLETE Program and GraphicalUser Interface Design