Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Visual Basic Express is a programming language for the Windows operating system. You can
create various applications for your school or for your daily activities. Though it simple, it can be
powerful. That is why Visual Basic Express is widely used in business, training and
entertainment.
3.0 What will you produce using Microsoft Visual Basic Express 2005?
It is hope that at the end of this lesson, you will be able to produce a simple program that
consists of Your Biodata. In your program you will learn how to create a program that has your
photo, your particulars and how to create a user log in that uses password. In doing so, you will
experience using simple coding in Microsoft Visual Basic Express 2005.
1
ICTL for Secondary School - Visual Basic Express Module
2
ICTL for Secondary School - Visual Basic Express Module
3
ICTL for Secondary School - Visual Basic Express Module
5. The Form Window is central to developing Visual Basic applications. It is where you
draw your application
6. Click ToolBox at the left side of the screen and all the control will be displayed. Click All
Windows Forms or Common Controls.
4
ICTL for Secondary School - Visual Basic Express Module
5
ICTL for Secondary School - Visual Basic Express Module
10. Create another three „TextBox‟, four „Label‟, one „PictureBox‟ and one „Button‟ according
to step 7, step 8 and step 9.
12. Click File and select „Save all‟ to save your project (Name : MyBiodata)
6
ICTL for Secondary School - Visual Basic Express Module
13. Set properties of the form, four TextBox, four Labels, one PictureBox and one Button :
Form1:
Text MyBiodata
Name frmBiodata
Label1:
Text Name
Label2:
Text Sex
Label3:
Text IC No
Label4:
Text Address
TextBox1
Name txtName
TextBox2
Name txtSex
TextBox3
Name txtICNum
TextBox4
Name txtAdd
Multiline true
PictureBox1
Image „browse image‟
Button1
Name btnExit
7
ICTL for Secondary School - Visual Basic Express Module
Text Exit
Select resource
(browse button)
8
ICTL for Secondary School - Visual Basic Express Module
Form1:
Backcolor „browse color‟(choose color)
txtName
Text type your name
txtSex
Text type your sex
txtICNum
Text type your IC Number
txtAdd
Text type your home address
9
ICTL for Secondary School - Visual Basic Express Module
20. To view the coding, double click the „Exit Button‟ and type the coding as below:
10
ICTL for Secondary School - Visual Basic Express Module
21. To Run (start) program, click (F5) and window will be displayed. Now your window
should look like this.
On the right frame, right click MyBiodata project. Choose Add and Click
Windows Form.
11
ICTL for Secondary School - Visual Basic Express Module
24. Now, your window form will look like this. Choose the „Windows Form‟ templates and
name the form (example : frmLogin). Then click „Add‟.
12
ICTL for Secondary School - Visual Basic Express Module
26. Create two „TextBox‟, two „Label‟, one „PictureBox‟ and two „Button‟ according to step 7,
step 8 and step 9.
27. Set properties of the form, two TextBox, two Labels, one PictureBox and one Button
frmLogin:
Text frmLogin
Name frmLogin
Backcolor „browse color‟(choose color)
Label1:
Text Name
Label2:
Text Password
TextBox1
Name txtName
TextBox2
Name txtPw
Passwordchar *
MaxLength 6
PictureBox1
Image „browse image‟
Button1
Name btnCancel
Text CANCEL
Button2
Name btnOK
Text OK
13
ICTL for Secondary School - Visual Basic Express Module
29. To view the coding, double click the „Cancel Button‟ and type the coding as below:
14
ICTL for Secondary School - Visual Basic Express Module
30. To view the coding, double click the „OK Button‟ and type the coding as below:
31. Before you „run‟ the frmlogin program, on the Bar Menu, click Project choose
MyBiodata Properties.
15
ICTL for Secondary School - Visual Basic Express Module
32. MyBiodata Properties form will be displayed. Go to Startup form, click drop down menu
and choose frmLogin.
34. To Run (start) program, click (F5) and window will be displayed. Now your window
should look like this.
35. To test the program, type name “123” and type Password “123”. Then click OK.
CONGRATULATIONS!!!
16
ICTL for Secondary School - Visual Basic Express Module
17