Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Class 7 Chapter 10

Introduction to Visual Basic 2008 (Solutions)

Brain Booster
A. Tick (3) the correct answer.
a. (ii) Programming language
b. (iii) Integrated Development Environment
c. (iv) Toolbox
d. (iv) Window State
e. (i) Show
B. Answer the following as True or False.
a. True
b. True
c. False
d. False
e. True
f. True
C. Match the following:
a. (v) Programming language
b. (iv) Event
c. (i) Form Property
d. (iii) .vb
e. (ii) Method
D. Fill in the blanks using the hints given in the Clue Box.
a. Event
b. Form
c. Windows state
d. Form_load
e. F5
E. Very short answer type questions.
a. Integrated Development Environment is provided by Visual Basic to develop the application.
b. Form in the design window is used for designing user interface.
c. Back color form property is used to change the color of text that appears on form or form objects.
d. Form_unload event is triggered when a form is closed.

Introduction to Visual Basic 2008 (Solutions) 1


F. Short answer type questions.
a. Visual Basic is also known as an event driven programming language as in this, program codes are executed in
response to the events that occur or sometime generated by the user like click, double click, key press, etc.
b. Various elements of Visual Basic IDE are:

Menu Bar: Menu bar at the top of IDE consists of various commands that can be used to work with your Visual
Basic project. At the time when no project is opened, the blank IDE has only six menus i.e., File, Edit, View, Tools,
Windows and Help but when you start working with project a full Visual Studio 2008 Menu bar consisting of ten
menus is displayed as shown in figure.
Toolbars: Toolbars consist of commands in the shape of buttons which provide quick access to often-used
commands. By default only standard toolbar is displayed, but you can always open other toolbars using View →
Toolbar option.

Toolbox: The toolbox offers various reusable tools like buttons, listbox, checkbox, textbox etc. which can be
used for creating application interface. These are referred to as controls in Visual Basic.

Design Window: This is the area where you work on your form to create user interface.
Solution Explorer: Solution Explorer contains a hierarchical view of your solution i.e., projects, forms, classes,
modules, etc.

Properties Window: A form can have many objects or controls on it. Every object has its own properties.
Properties window shows the properties of selected object and allow to modify them, if needed.
c. Form is the primary work area in Visual Basic which acts as a background for the other objects, placed on it to
form the user interface. It opens as a window when the program is executed. It is this form through which a user
interacts with an application. There can be multiple forms in a single project as an application can use many
different interfaces to interact with user.
d. The Visual Basic 2008 common control toolbox consist of all the essential controls required for the development
of an application. It shows common controls tools like Command Button, Label, Combobox, Listbox, Textbox,
PictureBox, etc.
To insert a control into your form, just drag it from the toolbox and drop it anywhere into the form or simply double
click the control in the Toolbox. The tool will appear on the form with its default name which you can change using
Name properly of the corresponding object.
e. To Run the Application:
● Click Debug → Start Debugging.
Or
● Click Start Debugging ( ) button on the Standard toolbar.
Or
● Press F5 function key.
G. Application oriented questions.
a. Arjun has to set Backcolor property of the form to blue and Name property of form to ‘Class VII project’.
b. Rajan needs label, textbox, message box and command button. The label will tell the user to enter a number. The
user will enter the number in the text box and when the user clicks the command button. The result will be shown
in the message box.

2 Introduction to Visual Basic 2008 (Solutions)


Activity Based Learning
A. Create the form as shown below. When the user clicks a button the back color of the form
should change to the selected color.
Double click Button1 i.e. Red and enter the following code.
Me.BackColor=Color.Red
Double click Button2 i.e. Blue and enter the following code.
Me.BackColor=Color.Blue
Double click Button3 i.e. Green and enter the following code.
Me.BackColor = Color.Green
B. Create the form as shown below. When the user clicks a button, a message will display
about that day of week. like:
Double click Button1 (Labelled Monday) and enter the following code.
Msgbox (“First day of the week”)
Double click Button2 (Labelled Tuesday) and enter the following code.
Msgbox (“Second day of the week”)
Double click Button3 (Labelled Wednesday) and enter the following code.
Msgbox (“Third day of the week”)
Double click Button4 (Labelled Thursday) and enter the following code.
Msgbox (“Fourth day of the week”)
Double click Button5 (Labelled Friday) and enter the following code.
Msgbox (“Fifth day of the week”)
Double click Button6 (Labelled Saturday) and enter the following code.
Msgbox (“Sixth day of the week”)
Double click Button7 (Labelled Sunday) and enter the following code.
Msgbox (“Seventh day of the week”)

Introduction to Visual Basic 2008 (Solutions) 3

You might also like