- Katılım
- 5 Ocak 2014
- Mesajlar
- 3,333
- Tepkime puanı
- 6
- Puanları
- 136
Eklenecek nesneler; timer1, shape1
(timer1'in interval özelliğini 10 yapıyoruz)
(shape1'in shape özelliğini circle seçiyoruz)
Kod:
Private Sub Timer1_Timer()Static ax, ayIf IsEmpty(ax) Thenax = 50ay = 50End IfIf Shape1.Top <= 0 Or Shape1.Top >= Form1.ScaleHeight - Shape1.Height Thenay = -ayBeepEnd IfIf Shape1.Left <= 0 Or Shape1.Left >= Form1.ScaleWidth - Shape1.Width Thenax = -axBeepEnd IfShape1.Left = Shape1.Left + axShape1.Top = Shape1.Top + ayEnd Sub
(timer1'in interval özelliğini 10 yapıyoruz)
(shape1'in shape özelliğini circle seçiyoruz)
Kod:
Private Sub Timer1_Timer()Static ax, ayIf IsEmpty(ax) Thenax = 50ay = 50End IfIf Shape1.Top <= 0 Or Shape1.Top >= Form1.ScaleHeight - Shape1.Height Thenay = -ayBeepEnd IfIf Shape1.Left <= 0 Or Shape1.Left >= Form1.ScaleWidth - Shape1.Width Thenax = -axBeepEnd IfShape1.Left = Shape1.Left + axShape1.Top = Shape1.Top + ayEnd Sub