0% found this document useful (0 votes)
85 views

ICT Literacy For: Secondary School

This document provides instructions for creating a simple login and biodata program using Microsoft Visual Basic Express 2005. The program allows a user to enter their name, sex, IC number, and address after logging in with a username and password. The steps outline how to set up the Visual Basic development environment, add controls like text boxes and buttons to different windows forms, set control properties, add images, and write basic code for form navigation and user input validation.

Uploaded by

Jams Angak
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
85 views

ICT Literacy For: Secondary School

This document provides instructions for creating a simple login and biodata program using Microsoft Visual Basic Express 2005. The program allows a user to enter their name, sex, IC number, and address after logging in with a username and password. The steps outline how to set up the Visual Basic development environment, add controls like text boxes and buttons to different windows forms, set control properties, add images, and write basic code for form navigation and user input validation.

Uploaded by

Jams Angak
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 17

KEMENTERIAN PELAJARAN MALAYSIA

Self Access Learning Module

ICT Literacy for Secondary School Programme


Visual Basic Express Development

PUSAT PERKEMBANAGN KURIKULUM KEMENTERIAN PELAJARANMALAYSIA

ICTL for Secondary School - Visual Basic Express Module

1.0 What is Microsoft Visual Basic Express 2005? Visual Basic Express is a programming language for the Windows operating syst You can em. create various applications for your school or for your daily activities. T hough it simple, it can be powerful. That is why Visual BasicExpress is widely used in business, training and entertainment. 2.0 Why use Microsoft Visual Basic Express 2005? Other reasons of using Microsoft Visual Basic Express 2005 are:

It is free to download and use! We can create standalone Windows programs royalty free. Full tutorial and many example programs are provided onli ne. It has large online community. It uses Graphical User I terface (GUI). n It uses drag and drop interface designer. It has interactive development environment. It is easy to carry out debugging.

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 pr oduce a simple program that consis ts of Your Biodata. In your program youwill learn how to create a program that has your photo, your particulars and how to create a user log in that uses passwo In doing so, you will experience rd. using simple coding in Microsoft Visual Basic Express 2005. 3.0 Getting started wi h Microsoft Visual Basic Express 2005 t

ICTL for Secondary School - Visual Basic Express Module

1. Click Start Program Microsoft Visual Basic 2005 Express Editio n Visual Basic 2005 Express will bedisplayed

2. To create new project, select File New Project

Window Form Screen will be dis played

ICTL for Secondary School - Visual Basic Express Module

3. In Visual Studio installed templates on the scr een, select Windows Application

4. Then, name your project - Exa mple : MyBiodata Click OK

ICTL for Secondary School - Visual Basic Express Module

5. The Form Window is ce ntral to developing Visual Basic applications. Itis where you draw your application

6. Click ToolBox at the left side of the screen and all the control will be displayed.

ICTL for Secondary School - Visual Basic Express Module

7. Click TextBox control .

8. Drop onto the Form1

ICTL for Secondary School - Visual Basic Express Module

9. Click and drag the Textbox to resize.

10. Create another three TextBox, four Label, on PictureBox and one Button acco e rding to step 7, step 8 and step 9. 11. Your form should now look likethis.

12. Click File and select Save all to save your project (Name :MyBiodata)

ICTL for Secondary School - Visual Basic Express Module

13. Set properties of the fo four TextBox, four Labels, one PictureBox and one Button : rm,

Form1: Text Name Label1: Text Label2: Text Label3: Text Label4: Text TextBox1 Name TextBox2 Name TextBox3 Name TextBox4 Name Multiline PictureBox1 Image Button1 Name Text MyBiodata frmBiodata Name Sex IC No Address txtName txtSex txtICNum txtAdd true browse image btnExit Exit

ICTL for Secondary School - Visual Basic Express Module

14. To browse image (for PictureBox1)in Properties, click browse button

Select resource (browse button)

15. Select Resource win dow will be displayed

16. Click Local resource then click Import button.

ICTL for Secondary School - Visual Basic Express Module

17. Now, choose image file (example : winter)

18. Your form should now look likethis.

19. Next, set properties of the form : Form1: Backcolor txtName Text txtSex Text txtICNum Text txtAdd Text type your home address type your sex type your IC Number browse color(choose color) type your name

ICTL for Secondary School - Visual Basic Express Module

20. To view the coding, do uble click the Exit Button and type the coding asbelow: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click Application.Exit() End Sub

10

ICTL for Secondary School - Visual Basic Express Module

21. To Run (start) program, click should look like this.

(F5) and window will be dis played. Now your window

22. Press Exit button to cl se your application o 23. To add a new window form : Right click MyBiodata project. On the right frame, then cho ose Add 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.

25. Your form will be displayed.

12

ICTL for Secondary School - Visual Basic Express Module

26. Create two TextBox, two Label, o PictureBox and two Button acc ne ording to step 7, step 8 and step 9.

27. Set properties of the fo two TextBox, two Labels, one PictureBox and one Button rm, Form1: Text Name Backcolor Label1: Text Label2: Text TextBox1 Name Password txtName Name frmLogin frmLogin browse color(choose color)

TextBox2 Name txtPw Passwordchar * MaxLength 6 PictureBox1 Image Button1 Name Text Button2 Name Text browse image btnCancel CANCEL btnOK OK

13

ICTL for Secondary School - Visual Basic Express Module

28. Your form should now look likethis

29. To view the coding, do uble click the Cancel Button and type the coding as below: Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Me.Close() End Sub

14

ICTL for Secondary School - Visual Basic Express Module

30. To view the coding, do uble click the OK Button and type the coding asbelow: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click If txtName.Text = "123" And txtPw.Text = "123" Then Form1.Show() Me.Hide() Else MessageBox.Show("Incorrect username or password, please try again" ) End If End Sub

31. Before you run the frmlogin progr m, on the Bar Menu, click Project choose a MyBiodata Properties.

15

ICTL for Secondary School - Visual Basic Express Module

32. MyBiodata Properties form will be displayed. Go to Startup form, clickdrop down menu and choose frmLogin.

33. To save the applicatio click Save all n,

34. To Run (start) program, click should look like this.

(F5) and window will be dis played. Now your window

35. To test the program, type name 123 and type Password 123. Then click OK.

CONGRATULATIONS!!! YOU HAVE CREATED A PROGRAM!


16

You might also like