Arkadaşlar visual basıc'te basit bir araba yarışı yapalım.İsterseniz siz üstüne ekleyip de geliştirebilirsiniz.
Başlayalım.İlk önce
Formumuza 2 adet textbox,1 adet buton ve 1 adet de timer ekleyelim.
İlk önce
Timer'in içine
Dim a, b As Integer
Randomize()
a = Int(Rnd(300) * 100)
b = Int(Rnd(300) * 100)
TextBox1.Left = TextBox1.Left + a
TextBox2.Left = TextBox2.Left + b
If TextBox1.Left >= 100 Then
a = MsgBox("A Arabası kazandı")
End
End If
If TextBox2.Left >= 100 Then
a = MsgBox("B Arabası Kazandı")
End
End If
BUTONUN İÇİNE
Timer1.Enabled = True
Timer1.Interval = 100
KODLARINI EKLEDİKTEN SONRA FORMU ÇALIŞTIRIN.iŞTE BU KADAR ..
Başlayalım.İlk önce
Formumuza 2 adet textbox,1 adet buton ve 1 adet de timer ekleyelim.
İlk önce
Timer'in içine
Dim a, b As Integer
Randomize()
a = Int(Rnd(300) * 100)
b = Int(Rnd(300) * 100)
TextBox1.Left = TextBox1.Left + a
TextBox2.Left = TextBox2.Left + b
If TextBox1.Left >= 100 Then
a = MsgBox("A Arabası kazandı")
End
End If
If TextBox2.Left >= 100 Then
a = MsgBox("B Arabası Kazandı")
End
End If
BUTONUN İÇİNE
Timer1.Enabled = True
Timer1.Interval = 100
KODLARINI EKLEDİKTEN SONRA FORMU ÇALIŞTIRIN.iŞTE BU KADAR ..