Visual Basic
Visual Basic
CONTROLS OR OBJECTS
Controls or objects are the primary medium of the
users interaction with the application system on which
we design and develop. Mostly, we use controls to get
the user input and to display the corresponding output.
The other controls provide us an access to some
application system and process data or information as
though the remote application system is part of our
program.
When people ask me what is the best way to
learn programming or how to use a specific
language, I tell them to experiment write as
many small programs as you can, as each
one will teach you more and each one will
add another trick to your tool bag.
-Alan Cooper
(Father of Visual Basic)
USING BUTTON AND TEXT BOX
The function of a Button is to carry out a
command or action (event) as the user clicks it, while the
text box provides an area to input or display text. We can
use the Button to extract simple responses from the user
or to invoke special functions on the form. The text
boxes are commonly used to display string or numeric
data and to accept user input or for entering data.
Example 1:
Design and develop an application system
when the user clicks the Greet Now! Button, the
Hello World! will be displayed at the text box.
the given figure below in designing and developing
application system.
Hello World!
Greet Now!
Text box
Button
Button and Text box design
vbButton1
Private Sub Button1_Click (ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
TextBox1.Text = Hello World!
End Sub
Tip:
You can also use Microsoft Windows XP, instead
of Windows Vista as your operating system when
developing all the programs or examples here in this
book. It just work fine in either of these two operating
system .
Sample Output:
Button and text box design output
X
Form1
Hello World!
Greet Now!
Explanation:
We usually use the Button to get simple
responses from the user such as clicking it to do some
action. We will notice here that the embedded code
(within the method):
TextBox1.Text = Hello World!
Is simply changing the Text property of the
object named TextBox1
To display Hello World! at the Text box control. Text
box is commonly used for accepting input or for
entering data, but in this example, it is used to display
the data.
Object.property
Where TextBox1 is the object (control) and Text is
the property. We can use this syntax to change property
settings for any form or control in response to events that
occurs while our application system is running.
Example 2:
Design and develop an application system that
when the user clicks the Greet Now! Button, the message
Hello Word! will be displayed at the message box.
vbButton2
Great Now!
Hello Word!
OK
Message Box
Button
Button and Message box design
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As
System.EventsArgs) Handles
Button1.Click
MessageBox.Show(Hello World!)
End Sub
Tip:
The term caption refers to Text property
of a control. To change the caption means to
change the Text property of a control.
Sample Output:
Button and Message box output
X
Form1
Greet Now!
X
Hello
World!
OK
EXPLANATION:
We usually use the button to get simple responses
from the user such as clicking it to do some action. We
will notice here that the embedded code (within the
method):
MessageBox.Show(Hello World);
Is simply to display the message Hello world!
at the Message box control.
A message box is used for displaying simple message
to the user.
USING CHECK BOXES, RADIO
BUTTONS AND MESSAGE BOX
Check boxes are valid as single controls,
however they are not mutually exclusive. Meaning,
the user can check as many check boxes as they want,
unlike in Radio buttons, the user can only select one
option at a time.
EXAMPLE 3:
Design and develop a smile Check box and Text
box application that when the user clicks one of the three
check boxes, it will indicate in the text box on which
check box the user had clicked.
Check 1
vbCheckBox1
Check box and Text box design
Check box 2 is clicked!
Check 2
Check 3
Private Sub
CheckBox1_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles CheckBox1.CheckedChanged
TextBox1.Text = Check box 1 is clicked!
End Sub
Private Sub
CheckBox2_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles CheckBox1.CheckedChanged
TextBox1.Text = Check box2 is clicked!
End Sub
Private Sub
CheckBox3_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles CheckBox3.CheckedChanged
TextBox1.Text = Check box 3 is clicked!
End Sub
Sample Output:
Check box and Text box design output
X
Check box 2 is clicked!
Check box 1
Check box 1
Check box 1
EXPLANATION:
Although a check box controls is rather similar
to a Radio button which we will describe in the
upcoming examples, there are two fundamental
differences between them. You can select many
choices in checked boxes while in Radio button you
are only allowed to select one option at a time. You
can observe that when you click the check box 1
(Check 1) then you click the check box two (Check
2), these two check boxes have the check mark on
the both of them. And even when you click the
check box three (Check 3), it will also contain the
check mark.
textBox1.Text=Check box 1 is clicked!
Is simply changing the Text property of the object
named Textbox1 to display Check box 1 is clicked! at
the Text box control. The syntax for our example takes
the format of
Object.property
where TextBox1 is the object (control) and Text is
the property. We can use this syntax to change
property settings for any form or control in response to
events that occurs while our application system is
running. The specific event here is the click event
which is generated by clicking the check boxes.
Example 4:
Design and develop a simple Check box and
Message box application that when the user clicks one
of the three check boxes, it will indicate in the Message
box on which check box the user had clicked. For
example if Check box 2 was clicked by the user it will
display Check box 2 is clicked! at the Message box.
It will do the same with Check box 1 and Check box 3.
vbCheckBox2
Check 1
Check 3
Check 2
Project1t
Check box and Message box design
Check box 2
clicked!
Private Sub CheckBox1_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
CheckBox1.CheckedChanged
MessageBox.Show (Check box 1 is clicked!)
End Sub
Private Sub CheckBox2_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
CheckBox2.CheckedChanged
MessageBox1.Show (Check box 2 is clicked!)
End Sub
Private Sub CheckBox3_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
CheckBox3.CheckedChanged
MessageBox1.Show(Check box 3 is clicked!)
End Sub
X Form1
CheckBox1
CheckBox2
CheckBox3
Check box 1 is clicked!
OK
X MsgBoxex1
Check box and Message box design output
EXPLANATION:
A message Box is used for displaying simple
message to the user. We will notice here that the
embedded code (within the method):
MessageBox.Show(Check box 1 clicked!)
Is simply to display the message Check box 1 is
clicked! at the Message box control. The same things
happens to other check boxes if we click them. The
Message box control is a pop-up dialog box that displays
the message that we would like to convey to the user.
EXAMPLE 5:
Design and develop a simple Text box and Radio
buttons application that when the user clicks one of the
three Radio buttons, it will indicate in the Text box on
which Radio button the user had clicked. For example if
Radio button 2 was clicked by the user , it will display
Radio button 2 is clicked! at the Text box. It will do
the same with Radio button 1 and Radio button 3.
vbRadiobutton1
Radio button 2 is clicked!
Radio Button 1
Radio Button 2
Radio Button 3
Text box and Radio buttons design
Private Sub
RadioButton1_CheckedChanged(ByVal sender As
System.Object, ByVal e As System.EventsArgs)
Handels RadioButton1.CheckedChanged
TextBox1.Text = Radio button 1 is clicked!
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventsArgs) Handels
RadioButton2.CheckedChanged
TextBox2.Text = Radio button 2 is clicked!
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventsArgs) Handels
RadioButton3.CheckedChanged
TextBox3.Text = Radio button 3 is clicked!
End Sub
SAMPLE OUTPUT:
Text box and Radio buttons output
X
Radio button 2 is clicked!
radioButton1
Form1
radioButton2
radioButton3
EXPLANATION:
Once you next click the next Radio button, the
bullet or the big black dot will transfer from the previous
button to the currently clicked Radio button.
TextBox1.Text = Radio button 1 is clicked!
Is simply changing the Text property of the object
named TextBox1 to display Radio button 1 clicked! at the
Text box control.
Object.property
Where TextBox1 is the object (control) and Text is the
property. We can use this syntax to change property settings for
any form or control in response to events that occur while our
application system is running. The specific event here is the click
event which is generated by clicking the Radio buttons.
Example 6:
Design and develop a simple Message box and Radio
buttons application that when the user clicks one of the three
Radio buttons, it will indicate in the Message box on which
Radio button the user had clicked. For example if Radio button 2
was clicked by the user, it will display Radio button 2 is
clicked! at the Message box.
vbRadiobutton2
Radio 1
Radio 2
Radio 3
Radio button 2 is clicked!
Project 1
Message box and Radio buttons design
Private Sub RadioButton1_CheckedChanged(ByVal
sender As System.Object, ByVal e As Sytem.EventArgs)
Handles RadioButton1.CheckedChanged
If RadioButton1.Checked = True Then
MessageBox.Show(Radio button 1 clicked!)
End If
End Sub
Private Sub RadioButton2_CheckedChanged(ByVal
sender As System.Object, ByVal e As Sytem.EventArgs)
Handles RadioButton2.CheckedChanged
If RadioButton2.Checked = True Then
MessageBox.Show(Radio button 2 clicked!)
End If
End Sub
Private Sub RadioButton3_CheckedChanged(ByVal
sender As System.Object, ByVal e As
Sytem.EventArgs) Handles
RadioButton3.CheckedChanged
If RadioButton3.Checked = True Then
MessageBox.Show(Radio button 3 clicked!)
End If
End Sub
SAMPLE OUTPUT:
Message box and Radio buttons design output
X
X Form1
RadioButton1
RadioButton2
RadioButton3
RadioButton2 is clicked!
OK
EXPLANATION:
You will noticed that the Radio button 1 is by default,
the first control to be selected. Its because in Radio button
controls, one of its control object must be selected, and
only one of the controls must be selected exclusively.
A message box is used for displaying simple messages to
the user.
If RadioButton1.Cheked= True Then
MessageBox.Show(Radio button 1 clicked!)
.
.
.
Is simply to display the message Radio button 1
clicked! at the Message box control.
EXAMPLE 7 :
Design and develop a simple Text box and
Ribbon buttons application that when the user clicks
one of the four radio buttons, it will indicate in the Text
box on which radio button the user had clicked. For
example if radio button 2 (second Year) was clicked
by the user, it will display sophomore at the Text
box. It will do the same with Radio button 1, Radio
button 3, and Radio button 4. The High school level
of First Year is Freshman, for Second Year is
Sophomore, for Third Year is Junior while for
Fourth Year is Senior
vbHighschool2
High School Level:
Sophomore!
First Year
Second Year
Third Year
Fourth Year
Is so called: Text box
Radio buttons and Text box design 2
Private Sub Radiobutton1_CheckedChange (ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
RadioButton1.CheckedChanged
TextBox1.Text = Freshman!
End Sub
Private Sub RadioButton2_CheckedChange(ByVal
sender As System.Object, ByVal e As
System.eventArgs) Handles
RadioButton2.CheckedChanged
TextBox1.Text = Sophomore!
End Sub
Private Sub
RadioButton3_CheckedChanged(ByVal sender
As System.Object, ByVal e As System.EventArgs)
Handles RadioButton3.CheckedChanged
TextBox1.Text = Junior!
End Sub
Private Sub
RadioButton4_CheckedChanged(ByVal sender
As System.Object, ByVal e As System.eventArgs)
Handles RadioButton4.CheckedChanged
TextBox1.Text = Seniors!
End Sub
SAMPLE OUTPUT:
High School Level:
First Year
Second Year
Third Year
Fourth Year
Is so called: Freshman!
X Form1
Radio buttons and Text box design 2 output
EXPLANATION:
TextBox1.Text = Freshman!
-is simply changing the Text property of the
object named TextBox1 to display Freshman! at
the Text box control. The same things happens to
other radio buttons if we clicked them. The syntax
for our examples takes the format of
object.property
Where TextBox1 is the object (control) and
text is the property. We can use this syntax to
change property settings for any form or control in
the response to events that occur while our
application system is running. The specific event
which is generated by clicking the radio buttons.
In our example you will notice that there will
always be a default selection in Radio button
control. And that default is the Radio button 1.
HIDING AND DISABLING CONTROLS
We will tackle some program examples that
demonstrate on an actual basis how to hide or
disable control. It is very easy. We just simply set
the Enable or Visible property of a particular control
to false at the design time. Or alternatively, we can
set it at the run- time, by issuing this syntax:
Objectname.Enable = false;
Or
Objectname.Visible = false;
Note:
When we talk about time it means that we
are modifying our program as we design it on the
Form where we can set the Controls property
through the Property Window.
EXAMPLE 8:
Design and develop an application system that
disables or enables a Button, and displays its
feedback to the textbox. When the users clicks the
Try to Click Me! Button, the feedback that says
Yes! I was Enable! Thank You! should be
displayed at the Text box. Now when the users
clicks the Disable Button! Radio button, the button
control should be displayed(grayed), and the
feedback that says you Disabled the Button! is
displayed at the Text box. Plus, the Try to Click Me!
Button is unclickable. Now when the users clicked
the Enable Button! Radio Button, the Try to Click
Me! Button should be restored to its enable state,
and the feedback that says You Enabled the
Button! should be displayed at the Text box.
Try to Click Me!
Enable Button!
Disable Button!
Button
Text Box
Radio Buttons
Disabling and Enabling Controls
vbDisableControl1
Private Sub Button1_Click(ByVal sender As
System.Object,ByVal e As System.EventArgs) Handles
Button1.Click
Textbox1.Text = Yes! I was Enabled!, thank you!
End Sub
Private Sub RadioButton1_CheckChanged (ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
RadioButton!.CkeckedChanged
Button1.Enabled = True
TextBox1.Text = You Enabled the Button!
End Sub
Private Sub RadioButton2_CheckedChanged
(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles
Button1.Enabled = False
Textbox1.Text = You Disabled the Button!
End Sub
SAMPLE OUTPUT:
Try to Click Me!
You Disabled the button!
Enable
Button!
Disable Button!
Disabling and Enabling Controls output
X
Form1!
EXPLANATION:
When the user clicks the enable radio button
(radio button1), we enabled it through the following
code:
Private Sub
RadioButton1_CheckedChanged(ByVal sender
As System.Object,ByVal e As System.EventArgs)
Handles RadioButton1.CheckedChanged
Button1.Enabled = True
Textbox1.Text = You Enable the Button!
End Sub
Now when the user clicks the Disable radio
button (radiobutton2), we disable it through the
following code:
Private Sub
RadioButton2_CheckedChanged(ByVal sender
As System.Object,ByVal e As System.EventArgs)
Handles RadioButton2.CheckedChanged
Button1.Enabled = False
Textbox1.Text = You Disabled the Button!
End Sub
EXAMPLE 9:
Design and develop an application system that
shows or hides Radio button1.
vbShowHideControl1
radioButton1
radioButton2
radioButton3
radioButton4
Hide Radio1! Show Radio1!
Buttons
Showing and Hiding Controls
Private Sub Button1_Click(ByVal sender As
System.Object,ByVal e As System.EventArgs)
Handles Button1.Click
RadioButton1.Visible = False
End Sub
Private Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
RadioButton1.Visible = True
End Sub
SAMPLE OUTPUT:
Form1! X
RadioButton1
RadioButton2
RadioButton3
RadioButton4
Hide Radio1! Show Radio1!
Showing and Hiding Controls output
EXPLANATION:
When the user clicks the Hide radio button
(radioButton1), we hide it through the following
code:
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
RadioButton1.Visible = False
End Sub
Now when the user clicks the Show radio button
(radioButton2), we show it through the following
code:
Private Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
RadioButton1.Visible = True
End Sub
TWEAKING THE HIGH SCHOLL
LEVEL EXAMPLE A LITTLE BIT
This is in the case of our High School Level
example where we saw that during the time we run
our program, the default selection will always be the
First Year radio button, thus its corresponding
displayed message is Freshman!.
What we want is to able to display all the list
of radio buttons as empty (unselected), so that
there is no message displayed at the Text box, by
default.
EXAMPLE 10:
Design and develop a simple Text box and
Radio buttons application that when the user clicks
one of the four radio buttons, it will indicate in the
Text box on which radio button the user had clicked.
For example if radio button 2 (Second Year) was
clicked by the user, it will display Sophomore! at
the Text box. It will do the same with Radio button
1, Radio button 3 and Radio button 4. the high
school level of First Year is Freshman!, for Second
Year is Sophomore!, for Third Year is Junior!
while for the Fourth Year is Senior!.
vbHighShool3
Tricky presentations!
Radio button 1 is intentionally, hidden
radioButton1
First Year
Second Year
Third Year
Fourth Year
Sophomore!
Hide Radio1! Show Radio1!
Text Box
Buttons
Hiding some controls to trick up the application
Private Sub Form1_Load(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
RadioButton1.Visible = False
RadioButton1.Checked = True
End Sub
Private Sub
RadioButton1_CheckedChanged(ByVal sender
As System.Object, ByVal e As System.EventArgs)
Handles RaddioButton1.CheckedChanged
TextBox1.Text =
End Sub
Private Sub
RadioButton2_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
TextBox1.Text = Freshman!
End Sub
Private Sub
RadioButton3_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
RaddioButton3.CheckedChanged
TextBox1.Text = Sophomore!
End Sub
Private Sub RadioButton4_CheckedChanged(ByVal
sender As System.Object, ByVal e As
system.EventArgs) Handles
RadioButton4.CheckedChanged
TextBox1.Text = Junior!
Private Sub RadioButton5_CheckedChanged(byVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
RadioButton5.CheckedChanged
TextBox1.Text = Senior!
End Sub
Private Sub Button1_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles Button1.Click
RadioButton1.Visible = True
TextBox1.Text = I just hide for a purpose!
End Sub
Private Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs)
Handles Button2.Click
RadioButton1.Visible = False
TextBox1.Text =
End Sub
SAMPLE OUTPUT:
X
Tricky presentations!
Radio button 1 is intentionally, hidden
First Year
Second Year
Third Year
Fourth Year
Sophomore!
Hide Radio1! Show Radio1!
Hiding some controls to trick up the application
EXPLANATION:
The first time we run our application system,
we need to hide right away the first radio button so
that it wont appear. This is the trick that we are
doing to our control , so that it appears as though
there is no pre- selection happened in our radio
buttons control.
To hide the first button from appearing and
selected when we run our application program,. We
need to set the code this way:
Private Sub Form1_Load(ByVal sender As
System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
RadioButton1.Visible = False
RadioButton1.Checked = True
End Sub
Once the button 1 (Show radio1) is clicked by
the user, we have to empty the text box
from any text message on it. We did it
through the following code:
Private Sub RadioButton1_CheckedChanged(ByVal
sender As System.Object, ByVal e As
System.EventAargs) Handles
RadioButton1.CheckedChanged
TextBox1.Text =
End Sub
When the user clicks the Button2 (Hide Radio 1), we have
to hide the radio button 1 with the following code:
Private Sub Button2_Click(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
Button2.Click
RadioButton1.Visible = False
TextBox1.Text =
End
When the user clicks the First Year radio
button, the output text Freshman! will be displayed
at the text box. We did it by using the following
code:
Private Sub
RadioButton2_CheckedChanged(ByVal sender
As System.Object, ByVal e As System.EventArgs)
Handles RadioButton2.CheckedChanged
TextBox1.Text = Freshman!
End Sub
This will also produce the same effect to other
remaining selections of radio buttons.
EXAMPLE 11:
Design and develop an application system that when
the user points the mouse- pointer at any control on the
Form, it will display the tooltip of what kind of control it is
pointing to.
vbToolTip1
Point your mouse to any of the controls:
Label1
Button1
CheckBox1
RadioButton1
Simple ToolTip Program
Private Sub Form1_Load(ByVal sender As
System.Object, ByVal e As System.EventAtgs)
Handles MyBase.Load
ToolTip1.SetToolTip(Me, This is a Form!)
ToolTip2.SetToolTip(Label2, This is a Label!)
ToolTip3.SetToolTip(Button1, This is a Button!)
ToolTip4.SetToolTip(CheckBox1, This is a
Check Box!)
ToolTip5.SettoolTip(RadioButton1, This is a
Radio Button!)
End Sub
SAMPLE OUTPUT:
X
Form1
Point your mouse to any of the controls:
Label1
Button1
CheckBox1
RadioB
This is a Check
Box!
Simple ToolTip program output
EXPLANATION:
Private Sub Form1_Load(ByVal sender As System.Object,
ByVal e As System.EventArgs) Handles MyBase.Load
ToolTip1.SetToolTip(Me, This is a Form!)
ToolTip2.SetToolTip(Label1, This is a Label!)
ToolTip3.SetToolTip(Button1, This is a Button!)
ToolTip4.SetToolTip(CheckBox1, This is aCheck
Box!)
ToolTip5.SetToolTip(RadioButton1, This is a Radio
Button!)
End Sub
The Me of the ToolTip1.SetToolTip object and method
parameter means the Form control. The other tooltips
parameters are self- explanatory.
EXAMPLE 12:
Design and develop an application system that
will echo the message typed at the Text box to the
Label with bigger font size.
vbEcho1
Enter a message to echo:
Label 2
A Simple Echo program
Text Box
Enter a message to echo:
vbEcho1
How are you buddy? Are you in or out?
Text Box
How are you buddy? Are you in or out?
A Simple Echo program
Private Sub TextBox1_TextChanged(ByVal
sender As System.Object, ByVal e As
System.EventArgs) Handles
TextBox1.TextChanged
Label2.Text = sender.Text
End Sub
Sample Output:
X Form1
Enter a message to echo:
Hello buddy? Are you in or out?
Hello buddy? Are you in or out?
A Simple Echo program
EXPLANATION:
Echoing a message typed at the text box
control is very simple and easy. We just simply
used the TextBox1_TextChanged method
parameter sender and its Text property
respectively, to be stored at Label2.Text control.
With this we can echo the message we typed at
textbox into the We can accomplish this task by
the following code:
label control.
Private Sub TextBox1_TextChanged(By Val sender
As System.Object, ByVal e As System.EventArgs)
Handles TextBox1.TextChanged
Label2.Text = sender.Text
End Sub
We can also solve the program above using the
following syntax:
Private Sub TextBox1_TextChanged(By Val sender
As System.Object, ByVal e As System.EventArgs)
Handles TextBox1.TextChanged
Label2.Text = TextBox1.Text
End Sub
EVENT-DRIVEN PROGRAMMING
In the preceding examples above, we learned
how event- driven application systems works. An
event is an action recognized by a control or form.
An event- driven application system executes
Visual Basic program in response to an event.
OBJECT AND CLASSES DEFINED
Object is simply a combination of program and
data that can be treated as a unit. Like for example,
a Form or a Button is an object. Inside (or behind) a
Button is a program and data which we can use to
manipulate itself. Its data such as the caption, size,
or color can be modified to suit our needs. These
program and data are encapsulated within an
object, thus eliminates conflict to other code in
other object or module.
Classes are the blue print or template of an
object. It is just saying, If a floor is an object, then its
floor- plan is the class. Without the floor- plan, the floor
can be impossibly built. The same goes to an object,
without the class, it is impossible to create it. The
object in Visual Basic (or even in Visual C# or Visual
C++) is defined by a class. A class defines the
characteristics of an object- for instance, its size and
shape.
The class is used to create an object. The
controls which are also called objects in the
Toolbox represent classes. When we design a
control(object) onto the form such as clicking,
dragging, and dropping a Button or text box, we
arereally creating a copy or an instance of the
control class. In this case the control class is the
Button class or Text box class. All
objects(controls) are created as identical copies
of their respective classes.
TO COMMENT OR NOT TO COMMENT
(THAT IS THE QUESTION!)
Making a comment or putting one or two in
your code, makes your program more readable and
comprehensible to other programmers or
developers. In other words, your program is a
programmer- friendly if it contains or comments
most especially to some part of your program which
are hard to understand or decipher.
A FRIENDLY REMINDER FOR THE
INSTRUCTORS
Since programming endeavor is a creative art
as well as an analytical science, I would like to
suggest that all the laboratory activity tests must be
open notes or open books (e-books or training
manuals), or even an open Internet research. In this
way, the students wont spend too much time
memorizing the commands and functions that they
will use in solving the problems presented.
Memorized the memory capacity is so precious
enough to be wasted only for things that need not
to be memorized such as commands and functions