by Michael Cattanach (1 Submission)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Wed 12th April 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)
This is a Magic 8 ball program
MyValue = Int((6 * Rnd) + 1)
If MyValue = 1 Then
Lblanswer = "Not today"
ElseIf MyValue = 2 Then
Lblanswer = "Definatly"
ElseIf MyValue = 3 Then
Lblanswer = "Not today"
ElseIf MyValue = 4 Then
Lblanswer = "Yes"
ElseIf MyValue = 5 Then
Lblanswer = "No"
ElseIf MyValue = 6 Then
Lblanswer = "My sorces say maybe"
End If
MyValue = Lblanswer
End Sub
dim DeltaX, DeltaY as Integer
Private Sub timer1_Timer()
img1.move img1.Left + DeltaY, img1.Top + DeltaX
If img1.Left < ScaleLeft Then DeltaY = 100
If img1.Left + img1.Width > ScaleWidth + ScaleLeft Then
DeltaY = -100
End If
If img1.Top < ScaleTop Then DeltaX = 100
If img1.Top + img1.Height > ScaleHeight + ScaleTop Then
DeltaX = -100
End If
'Make Sure Timer1.Enabled = True
Private Sub cmd1_Click()
Timer1.Interval = 50
DeltaX = 100
DeltaY = 100