Lab Manual That Includes Steps in Developing VB
Lab Manual That Includes Steps in Developing VB
Code Part
‘Declare Global Variables
Dim speed As Integer
Dim road(7) As PictureBox
Dim score As Integer
‘Road Move
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
speed = 3
road(0) = PictureBox1
road(1) = PictureBox2
road(2) = PictureBox3
road(3) = PictureBox4 Those Picture boxes
road(4) = PictureBox5
are the names of the
road(5) = PictureBox6
road(6) = PictureBox7 road signs
road(7) = PictureBox8
Label3.Visible = False
Button1.Visible = False
Button2.Visible = False
End Sub
‘Select RoadMover timer and double click on it and write the following code
End If
Next
If score > 10 And score < 30 Then
speed = 5
End If
If score > 30 And score < 50 Then
speed = 6
End If
If score > 50 And score < 70 Then
speed = 7
End If
If score > 70 And score < 80 Then
speed = 8
End If
If score > 80 And score < 100 Then
speed = 9
End If
If score > 100 Then
speed = 10
End If
If score > 150 Then
speed = 10
End If
Label2.Text = "Speed " & speed
If (car.Bounds.IntersectsWith(race1.Bounds)) Then
endgame()
Label4.Text = "Crushed with other car!"
End If
If (car.Bounds.IntersectsWith(race2.Bounds)) Then
endgame()
Label4.Text = "Crushed with other car!"
End If
If (car.Bounds.IntersectsWith(race3.Bounds)) Then
endgame()
Label4.Text = "Crushed with other car!"
End If
‘ If car.Bounds.IntersectsWith(LeftBoarder.Bounds) Or
car.Bounds.IntersectsWith(RightBorde.Bounds) Then
‘ endgame()
‘ Label4.Text = "Not Allowed going out of the Road"
‘End If
End Sub
Double Click on The following Timers and write the given codes
End Sub
End Sub
Setp 1,
1. Add textbox and make it multiline and dock center
2. Add menu strip with the following
3. Add the following items
a. Save Dialog Box
b. Print Dialogbox
c. FontDialogbox
d. colorDialogbox
e. openDialogbox