Lect01 Introduction of Visual Basic
Lect01 Introduction of Visual Basic
T U T O R I A L
Welcome
3
Application
Introduction to
Visual Programming
https://www.facebook.com/groups/252543721572219
Outline
Objectives
Introduction
Introduction (Cont.)
an object is a programming structure that encapsulates data
(properties) and functionality (methods) as a single unit
Figure 3.2 | Open Project dialog displaying the contents of the Welcome solution.
Figure 3.4 | Running the Welcome application using the Debug menu’s
Start Debugging command.
Toolbar
File properties
■ The title bar is the top portion of the window that contains the window’s
title.
■ To change this text, use the Properties window (Fig. 3.8).
– Click the gray area in the Form.
– Double click the field to the right of the Text property in the
Properties window to edit the field.
– Press the Enter key to update the Form’s title bar (Fig. 3.9).
Selected property
Property value
■ To resize the Form and its controls with the Size property,
click the Form to select it.
■ Then locate the Form’s Size property in the Properties
window (Fig. 3.11).
■ Click the plus box, , next to this property.
– Type 616 for the Width property value and press Enter.
– Type 440 for the Height property value and press Enter.
– You also can enter the width and height (separated by a
comma) in the Size property’s value field.
Down-arrow Button
Tabs
Custom palette
Current color
Figure 3.12 | Viewing the Custom palette in the Form’s BackColor property value
field.
■ Right click any one of the white boxes at the bottom of the
Custom palette to display the Define Color dialog
(Fig. 3.13).
■ Colors can be created by selecting a color in the rainbow
window and sliding the black arrow up and down.
■ The values for the Red:, Green: and Blue: TextBoxes
describe the amount of red, green and blue and are
commonly called RGB values.
– Each red, green and blue value is in the range 0–255, inclusive.
Figure 3.14 | Properties window after the new custom color has been added.
Label control
Label control
AutoSize property
Centered Label
Ellipsis Button
current font
Font sample
Figure 3.22 | Font dialog for selecting fonts, styles and sizes.
Middle-center alignment
option
Updated Label
PictureBox
Ellipsis Button
Figure 3.26 | Select Resource dialog to select an image for the PictureBox.
2009 Pearson Education, Inc. All rights reserved.
41
Inserting an Image and Running the
Welcome Application (Cont.)
PictureBox too
small for image
Form
Running application
Figure 3.43 | Component object box expanded to show Figure 3.44 | The name and class of an object are
the Welcome application’s objects. displayed in the component object box .