Page 233 - DCAP408_WEB_PROGRAMMING
P. 233
Unit 14: Text and Graphics Output
Dim a, b, c As Integer Notes
Private Sub Command1_Click ()
Randomize Timer
a = 3 + Int(Rnd * 3)
b = 3 + Int(Rnd * 3)
c = 3 + Int(Rnd * 3)
If a = 3 Then
Image1(0).Picture = LoadPicture(“C:\My Folder\VB program\Images\grape.gif”)
End If
If a = 4 Then
Image1(0).Picture = LoadPicture(“C:\My Folder\VB program\Images\cherry.gif”)
End If
If a = 5 Then
Image1(0).Picture = LoadPicture(“C:\My Folder\VB program\Images\orange.gif”)
End If
If b = 3 Then
Image1(1).Picture = LoadPicture(“C:\My Folder\VB program\Images\grape.gif”)
End If
If b = 4 Then
Image1(1).Picture = LoadPicture(“C:\My Folder\VB program\Images\cherry.gif”)
End If
If b = 5 Then
Image1(1).Picture = LoadPicture(“C:\My Folder\VB program\Images\orange.gif”)
End If
If c = 3 Then
Image1(2).Picture = LoadPicture(“C:\My Folder\VB program\Images\grape.gif”)
End If
If c = 4 Then
Image1(2).Picture = LoadPicture(“C:\My Folder\VB program\Images\cherry.gif”)
End If
If c = 5 Then
Image1(2).Picture = LoadPicture(“C:\My Folder\VB program\Images\orange.gif”)
End If
End Sub
LOVELY PROFESSIONAL UNIVERSITY 227