fragmatyc
Messages postés57Date d'inscriptiondimanche 9 mars 2003StatutMembreDernière intervention17 octobre 2009
-
27 août 2003 à 05:15
Renfield
Messages postés17287Date d'inscriptionmercredi 2 janvier 2002StatutModérateurDernière intervention27 septembre 2021
-
27 août 2003 à 06:48
jai ce code qui fait en sorte ke lorseke je pese sur la form1 a bouge comme dans un jeu de stratégie wargame (starcraft ...etc) mais le prob c que je ne sais po commen les fair arraiter
a = picturebox
t = timer
Dim varx As Single
Dim vary As Single
Private Sub Form_KeyPress(KeyAscii As Integer)
End
End Sub
Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
t.Enabled = True
varx = X
vary = Y
End Sub
Private Sub t_Timer()
If varx < a.Left + a.Width / 2 Then
a.Left = a.Left - 20
ElseIf varx > a.Left + a.Width / 2 Then
a.Left = a.Left + 20
End If
If vary < a.Top + a.Height / 2 Then
a.Top = a.Top - 20
ElseIf vary > a.Top + a.Height / 2 Then
a.Top = a.Top + 20
End If
End Sub