You are on page 1of 20

Visual Basci

F3 Student
STARTING VISUAL BASIC 2010
• To start Visual Basic 2010 Express, click on
Start > All apps > Visual Basic 2010 Express.
• The Start Page of Visual Basic 2010 Express
appears.
STARTING VISUAL BASIC 2010
• The Visual Basic 2010 Express Start Page consists of a few panes, namely:
Start: It provides some helpful options to develop the applications, like
New Project and Open Project.
RECENT: It displays the list of projects that have been created by you in
the recent past.
STARTING VISUAL BASIC 2010
• Click on the New Project option in the Start Section.
• To start a new Visual Basic Express 2010 project, simply
click on New Project option in the Start Section as
shown below:
• The New Project window will appear.
STARTING VISUAL BASIC 2010
• Select the Visual Basic in the left pane and choose the Windows Forms
Application option in the middle pane.
• Set the Project Name,
and Click OK.
STARTING VISUAL BASIC 2010
• The following window will appear.
• Visual Basic 2010 Express contains the Menu bar, Toolbar, Toolbox and
some other windows, Title Bar
such as Form window,
Solution Explorer window, Menu Bar Toolbar

Properties Window,
and the Error List, etc.
• Visual Basic 2010 Express Integrated Form Window Solution Explorer
Development Environment bundles
all these tools and provides us an
interface where we can design, edit,
compile and execute the application Main Window
on a single platform. Properties
Window
COMPONENTS OF VISUAL BASIC 2010
• FROM WINDOW: Form is a interface through which a user interacts with
the application.
• A Form contains many control elements, such as Label, TextBox, Button,
etc. Using these controls, a user can enter data and give instructions to
the application.
COMPONENTS OF VISUAL BASIC 2010
• Properties are the attributes that define the appearance and behavior of
objects(Forms and other controls).
• Forms have many properties, such as Name, Font, Color, BorderStyle,
Padding, Size, Text, etc.
• The properties window consists of
an object drop-down list and
a list of properties.
COMPONENTS OF VISUAL BASIC 2010
• Solution Explorer
This window displays a list of forms and other objects that constitute the
application. This list is organized in the form of a branching structure, like
Windows Explorer.
• To open any object, we can
double-click on its icon in the
Solution Explorer window.
COMPONENTS OF VISUAL BASIC 2010
• ToolBox
As the name suggests, the Toolbox contains various controls, such as
Button, Text Box, Label, etc.
• These controls can be added
to the forms by dragging and
placing them at the desired
location.
COMPONENTS OF VISUAL BASIC 2010
• Code window
This window is used to write codes for any object. To write codes,
double click the object on the Form.
• This action opens the Code window where we can write the required
Visual Basic statements.
Developing A VB Application
• To develop an application using VB 2010 Express, follow the given steps:
1. Build an interface by adding controls to the form.
2. Set properties of the controls.
3. Write codes on various events of added controls and run the
application.
Commonly used controls: Label
• A Label is used to display
descriptive text for a control.

• The below table show common properties


of Label control.

Name The Name property identifies a label while writing the program.
(If not necessary, please don’t change this property)

Font This property sets the font, font size, font style, etc., for the label.

ForeColor This property changes the foreground colour of the label used for displaying text.

Text This property is used to display the text on the label.

Visible This property determines whether the control is visible or hidden.


Commonly used controls: TextBox
• A TextBox is used to receive
input from the user. We can enter text
and numbers in this box.
• The below table show common properties
of TextBox control.

Name The Name property identifies a text box while writing the program.
(If not necessary, please don’t change this property)

Text This property is used to display the text in the text box.
Font This property is used to set the font, font size, font style, etc., for the text box.
Locked This property determines whether we can move or resize the control.
This property is used to set the maximum length of text that can be entered in a
MaxLength
text box.
This property decides, whether the text will be displayed in a single line or in
Multiline
multiple lines. By default, this property is set as false.
Commonly used controls: Button
• The Button is used to raise
an event in the application. When a user
clicks on the button, the programming
statements associated with that button
get executed.

• The below table show common properties


of Button control.

Name The Name property identifies a button while writing the program.
(If not necessary, please don’t change this property)

Text This property is used to display the text on the button.


Font This property set the font, font size, font style, etc., for the button.
Writing Codes for An Event
• Follow the given steps to write programming statements for any event.
• Here we are considering the Click event of a Button control.
• Now select a Label control and a Button control from the Toolbox and
place it on the form.
• A button will appear and it will have ‘Button 1’ as its name.
• Change its name to ‘Display’ using the Text property.
Writing Codes for An Event
• Double-click on the Display button to open the Code window.
• In the Code window, write the statements in between the pre-written
lines of code as shown in the Figure. Press F5 to execute the program.

Object Name
Object Property Assign some text value to the Label

In this example, the value is assigned to the label


when the button is clicked in the run time.
Writing Codes for An Event
• The Syntax to assign a value to the property of an object is:

Object.property = value
How to save your project
• File > Save All

• After, all the file will save in one folder.


Inside the folder
• If you need to send the file to teacher,
Please Zip the entire folder first.
Arithmetic Operators

You might also like