
Forma eklemeniz gereken araçlarımız:
1 tane shape
1 tane timer
Timer1'in interval özelliğini 10 olarak ayarlayın
Shape1'in shape özelliğini circle olarak ayarlayın
Private Sub Timer1_Timer() Static ax, ay If IsEmpty(ax) Then ax = 50 ay = 50 End If If Shape1.Top <= 0 Or Shape1.Top >= Form1.ScaleHeight - Shape1.Height Then ay = -ay Beep End If If Shape1.Left <= 0 Or Shape1.Left >= Form1.ScaleWidth - Shape1.Width Then ax = -ax Beep End If Shape1.Left = Shape1.Left + ax Shape1.Top = Shape1.Top + ay End Sub
Hiç yorum yok: