VB2010 sayesinde neler yapılabilir size göstermek için böyle bir uygulama yaptım.Eğer anlamadığınız yerler olursa yorumda sorabilirsiniz.
Yapım için gerekli olan araçlar ;
4 Buton
7 PictureBox
5 Timer
Buyrun kodlar;
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.Top = PictureBox1.Top - 40
Timer1.Start()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PictureBox1.Left = PictureBox1.Left - 40
Timer1.Stop()
Timer2.Start()
Timer3.Stop()
Timer4.Stop()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
PictureBox1.Top = PictureBox1.Top + 40
Timer1.Stop()
Timer2.Stop()
Timer3.Start()
Timer4.Stop()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
PictureBox1.Left = PictureBox1.Left + 40
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PictureBox1.Top = PictureBox1.Top - 40
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
PictureBox1.Left = PictureBox1.Left - 40
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
PictureBox1.Top = PictureBox1.Top + 40
End Sub
Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
PictureBox1.Left = PictureBox1.Left + 40
End Sub
Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
If PictureBox1.Location = PictureBox2.Location And PictureBox2.Visible = True Then
PictureBox2.Visible = False
PictureBox3.Visible = True
End If
If PictureBox1.Location = PictureBox3.Location And PictureBox3.Visible = True Then
PictureBox3.Visible = False
PictureBox4.Visible = True
End If
If PictureBox1.Location = PictureBox4.Location And PictureBox4.Visible = True Then
PictureBox4.Visible = False
PictureBox5.Visible = True
End If
If PictureBox1.Location = PictureBox5.Location And PictureBox5.Visible = True Then
PictureBox5.Visible = False
PictureBox6.Visible = True
End If
If PictureBox1.Location = PictureBox6.Location And PictureBox6.Visible = True Then
PictureBox6.Visible = False
PictureBox7.Visible = True
End If
If PictureBox1.Location = PictureBox7.Location And PictureBox7.Visible = True Then
PictureBox7.Visible = False
PictureBox2.Visible = True
End If
If PictureBox1.Left = 1 Then
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
PictureBox1.Left = 41
PictureBox1.Top = 12
MsgBox("oyun bitti")
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
End If
If PictureBox1.Top = -28 Then
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
PictureBox1.Left = 41
PictureBox1.Top = 12
MsgBox("oyun bitti")
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
End If
If PictureBox1.Left = 921 Then
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
PictureBox1.Left = 41
PictureBox1.Top = 12
MsgBox("oyun bitti")
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
End If
If PictureBox1.Top = 452 Then
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
PictureBox1.Left = 41
PictureBox1.Top = 12
MsgBox("oyun bitti")
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
Timer5.Start()
End Sub
End Class
Başta da söylediğim gibi anlamadığınız yer varsa sorabilirsiniz.
İncelemek isteyenler için buradan indirebilirsiniz.
Kolay Gelsin.
Yapım için gerekli olan araçlar ;
4 Buton
7 PictureBox
5 Timer
Buyrun kodlar;
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
PictureBox1.Top = PictureBox1.Top - 40
Timer1.Start()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
PictureBox1.Left = PictureBox1.Left - 40
Timer1.Stop()
Timer2.Start()
Timer3.Stop()
Timer4.Stop()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
PictureBox1.Top = PictureBox1.Top + 40
Timer1.Stop()
Timer2.Stop()
Timer3.Start()
Timer4.Stop()
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
PictureBox1.Left = PictureBox1.Left + 40
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
PictureBox1.Top = PictureBox1.Top - 40
End Sub
Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
PictureBox1.Left = PictureBox1.Left - 40
End Sub
Private Sub Timer3_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer3.Tick
PictureBox1.Top = PictureBox1.Top + 40
End Sub
Private Sub Timer4_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer4.Tick
PictureBox1.Left = PictureBox1.Left + 40
End Sub
Private Sub Timer5_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer5.Tick
If PictureBox1.Location = PictureBox2.Location And PictureBox2.Visible = True Then
PictureBox2.Visible = False
PictureBox3.Visible = True
End If
If PictureBox1.Location = PictureBox3.Location And PictureBox3.Visible = True Then
PictureBox3.Visible = False
PictureBox4.Visible = True
End If
If PictureBox1.Location = PictureBox4.Location And PictureBox4.Visible = True Then
PictureBox4.Visible = False
PictureBox5.Visible = True
End If
If PictureBox1.Location = PictureBox5.Location And PictureBox5.Visible = True Then
PictureBox5.Visible = False
PictureBox6.Visible = True
End If
If PictureBox1.Location = PictureBox6.Location And PictureBox6.Visible = True Then
PictureBox6.Visible = False
PictureBox7.Visible = True
End If
If PictureBox1.Location = PictureBox7.Location And PictureBox7.Visible = True Then
PictureBox7.Visible = False
PictureBox2.Visible = True
End If
If PictureBox1.Left = 1 Then
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
PictureBox1.Left = 41
PictureBox1.Top = 12
MsgBox("oyun bitti")
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
End If
If PictureBox1.Top = -28 Then
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
PictureBox1.Left = 41
PictureBox1.Top = 12
MsgBox("oyun bitti")
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
End If
If PictureBox1.Left = 921 Then
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
PictureBox1.Left = 41
PictureBox1.Top = 12
MsgBox("oyun bitti")
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
End If
If PictureBox1.Top = 452 Then
Timer1.Stop()
Timer2.Stop()
Timer3.Stop()
Timer4.Stop()
PictureBox1.Left = 41
PictureBox1.Top = 12
MsgBox("oyun bitti")
PictureBox2.Visible = True
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
End If
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
PictureBox3.Visible = False
PictureBox4.Visible = False
PictureBox5.Visible = False
PictureBox6.Visible = False
PictureBox7.Visible = False
Timer5.Start()
End Sub
End Class
Başta da söylediğim gibi anlamadığınız yer varsa sorabilirsiniz.
İncelemek isteyenler için buradan indirebilirsiniz.
Kolay Gelsin.
0 yorum:
Yorum Gönder
Yorumlarınızda lütfen Türkçe ' yi güzel kullanınız.
Bilgili Yayın Yönetimi...
Dikkat ! : Küfür yada uygunsuz içerik içeren yorumlar yasaktır.Bu tür yorumlar site yönetimi tarafından tespit edilip silinmektedir.Fakat gözden kaçan yorumları ctn@turk.tc veya tospmailbomber@gmail.com adreslerinden bizlere iletebilirsiniz.