16 Haziran 2013 Pazar

Gerekenler;
2 tane textbox ,1 tane command button ,3 tane line ,1 tane timer kullanmamız gerek!
Formumuza bunları yerleştirdikten sonra alta vermiş olduğum kodu yazınız!

Kod:
Timer 1 İçine;

Private Sub Timer1_Timer()
Randomize
a = Int(Rnd(300) * 100)
b = Int(Rnd(300) * 100)
Text1.Left = Text1.Left + a
Text2.Left = Text2.Left + b
If Text1.Left >= 5520 Then
a = MsgBox("A Arabası kazandı")
End
End If
If Text2.Left >= 5520 Then
a = MsgBox("B Arabası Kazandı")
End
End If
End Sub


Command1 Buttonunun içinede

Private Sub Command1_Click()
Timer1.Enabled = True
Timer1.Interval = 25
End Sub

0 yorum:

Yorum Gönder

Subscribe to RSS Feed Follow me on Twitter!