340 likes | 347 Views
Lesson 10. Developing a Simple Programme. At the end of this lesson, students should be able to:. Create object using toolbox: Textbox, Picturebox Declare Variables: String, Integer, Double Write codes Test and Debug Compile the program.
E N D
Lesson 10 Developing a Simple Programme
At the end of this lesson, students should be able to: • Create object using toolbox: Textbox, Picturebox • Declare Variables: String, Integer, Double • Write codes • Test and Debug • Compile the program
Click ToolBox at the left side of the screen and all the control will be displayed. Toolbox Figure 1
2. Click ‘TextBox’ control . Textbox Figure 2
3. Drop onto the Form1 Textbox Figure 3 4. Click and drag the Textbox to resize. Figure 4
5. Create another three ‘TextBox’. Four Text Boxes Figure 5
6. Click Label on the ToolBox Label Figure 6
7. Drop onto the Form1 Label Figure 7
8. Set properties of the form. Rename Text : Form1 to MyBiodata Figure 8 Rename Form1
Your Form Properties should be like this MyBiodata Figure 9
9. Set properties of the form. Rename Name : Form1 to frmBiodata frmBiodata Figure 10
10. Click Label1 Label1 Figure 11
11. Rename Text : Label1 to Name Label1 Figure 12
Your Text Properties must be like figure shown below. Name Figure 13
Result after rename Label1 to Name. Label Name Figure 14
12. Set properties of the Label2,Label3 and Label4 as shown below. Table 1
13. Click Textbox1 Textbox1 Figure 15
Rename Name :TextBox1 to txtname Figure 16
14. Set properties of the TextBox2,TextBox3 and TextBox4 as shown below. Table 2
Your form should be shown as Figure 17. Figure 17
15. Click ‘PictureBox’ control . PictureBox Figure 18
16. Drop onto the “MyBiodata” form PictureBox Figure 19
17. To browse image (for PictureBox1) in Properties, click browse button Click here Figure 20
19. Click ‘Local resource’. Then click ‘Import’. Step 1 : Click Local Resource Step 2 : Click Import Figure 22
20. Now, choose image file (example : winter). Then click Open. Figure 23 Step 1:Click “Winter” Step 2:Click Open
21. Your form should now look like this Figure 24
22. Click ‘Button’ control on the Toolbox Button Figure 25
23. Drop onto the “MyBiodata” form Button1 Figure 26 Button1
24. Set properties of the button1 Button1Name btnExitText Exit Exit Figure 27
25. Double click button “Exit” Figure 28 Double click here
26. Type the coding as below: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit. Click Application.Exit() End Sub Figure 29
28. To debug program, click Debug >> Start Debugging on menu bar. 29. To Run (start) program, click (F5) and window will be displayed. Now your window should look like this. 30. Press ‘Exit button’ to close your application. Figure 30