Download presentation
Presentation is loading. Please wait.
Published bySabrina Hubbard Modified over 6 years ago
1
Chapter 3: I Need a Tour Guide (Introduction to Visual Basic 2012)
2
Chapter Objectives After studying Chapter 3, you should be able to:
Create a Windows application in Visual Basic 2012 Use the Label and PictureBox tools to add controls to a form Set the properties of an object Save a solution Size, align, and center objects using the FORMAT menu Lock the controls on a form Start and end an application Close and open an existing solution Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
3
Ok, the Algorithm is Correct. What’s Next?
User Interface What the user sees and interacts with Integrated Development Environment (IDE) Contains all the tools and features needed to create the interface The combination of the user interface and the program’s code is referred to as an application. Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
4
Ok, the Algorithm is Correct. What’s Next? (Cont.)
Figure 3-1 Microsoft Visual Studio Professional 2012 startup screen Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
5
Ok, the Algorithm is Correct. What’s Next? (Cont.)
Figure 3-2 Options dialog box Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
6
Creating a Visual Basic Windows Application
Figure 3-3 Completed New Project dialog box in Visual Studio Professional 2012 Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
7
Creating a Visual Basic Windows Application (Cont.)
Figure 3-4 Solution and Visual Basic project Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
8
Creating a Visual Basic Windows Application (Cont.)
So Many Windows! Close windows you don’t want to see Use auto-hide to maximize design space Figure 3-5 Current status of the windows in the IDE Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
9
Creating the User Interface
Windows Form Designer window Create the GUI here Windows Form Object (Form) Foundation for the user interface Figure 3-6 Windows Form Designer window Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
10
Creating the User Interface (Cont.)
Controls Objects added to a form Toolbox window Contains tools use to create the interface Picture box Displays an image on a form Label controls Display text that user is not allowed to edit while application is running Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
11
Creating the User Interface (Cont.)
Figure 3-8 Label tool being dragged to the form Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
12
Creating the User Interface (Cont.)
Figure 3-10 A blue snap line appears when the borders are aligned Figure 3-11 A pink snap line appears when the text is aligned Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
13
Save, Save, Save Good practice To save a solution
Save current solution every 10 or 15 minutes To save a solution Click on File on the menu bar, then click Save All Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
14
Whose Property Is It? Properties
Determine object’s appearance and behavior Name and current value of each property Appear in the Properties window when the object is selected Properties window Object box contains the name of the selected object Properties list Two columns: Property names and settings box Settings box displays the current value of the property Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
15
Whose Property Is It? (Cont.)
Font General shape of text characters Measured in points Figure 3-13 Partial listing of the form’s properties Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
16
Using the FORMAT Menu Format menu
Provides several options for manipulating controls in the interface Useful options include Align and Make Same Size Reference control Is the first control selected Figure 3-17 Both picture boxes selected on the form Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
17
Lock Them Down Lock Controls
Prevents them from being moved inadvertently as you work in the IDE Figure 3-19 Controls locked on the form Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
18
Ok, Let’s See the Interface in Action!
Figure 3-20 Result of starting the Merlin the Cat application Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
19
Closing the Current Solution
To close a solution Use the Close Solution option on the File menu When you close a solution All projects and files contained in the solution are also closed Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
20
Opening an Existing Solution
To open an existing solution Use Open Project the File menu If a solution is already open in the IDE It is closed before another solution is opened Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
21
Exiting Visual Studio To exit Visual Studio
Use either the Close button on its title bar or The Exit option on the File menu Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
22
Summary Creating the user interface
Fourth step in the problem-solving process Windows applications in Visual Basic Composed of solutions, projects, and files Label controls Display text that user is not allowed to edit while an application is running Picture boxes Used to display images on a form Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
23
Summary (Cont.) Good practice to save solution every 10-15 minutes
Form’s StartPosition property Specifies the position of the form when it first appears on the screen Font property Determines the type, style, and size of font used to display text on the form Picture box control’s Image property Specifies name of file containing the image to display Good practice to lock the controls in place on form Clearly Visual Basic: Programming with Microsoft Visual Basic 2012
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.