cs_snake57
Messages postés204Date d'inscriptionvendredi 19 novembre 2004StatutMembreDernière intervention 1 novembre 2011
-
21 août 2005 à 17:31
cs_snake57
Messages postés204Date d'inscriptionvendredi 19 novembre 2004StatutMembreDernière intervention 1 novembre 2011
-
6 sept. 2005 à 18:18
Bonjour J'ai un petit problème avec un prog que je suis entrain de faire.
J'utilise une fonction qui me sert à déplacer des images.
Cette fonction calcul la position a laquelle doit être déplacé l'image et la déplace à l'endroit approprié.
Cette fonction est appelée par le clic souris sur l'image concernée.
Donc si je clique sur l'image A, celle-ci se déplace de A1 en A2.
Donc tout va bien.
Mais si je veux déplacer deux images simultanément sa ne fonctionne plus.
Je clique sur l'image A. Son déplacement commence. Ensuite je clique sur l'image B. Et la le déplacement de A s'arrète et celui de B commence. B se déplace jusqu'en A2 (la ou aurait due aller l'image A) et pour finir A réaparait mais en B2.
Voila j'aurais voulu savoir si qqn savait d'ou pouvait venire se problème!!!!
pjcleder
Messages postés183Date d'inscriptionjeudi 4 février 2010StatutMembreDernière intervention16 septembre 201111 21 août 2005 à 17:34
PAT
D'emblée comme çà, on pourrait tenter le DoEvents qui permet de laisser le temps au système de faire ce qu'il a à faire.
Tu le mets en début de procédure.
cs_snake57
Messages postés204Date d'inscriptionvendredi 19 novembre 2004StatutMembreDernière intervention 1 novembre 2011 21 août 2005 à 19:24
Voici le code si tu as besoin de précision demande moi.
En gros la fonction regarde sur quelle image j'ai cliquer grace au indice2_imageX.
Puis une image 70 se met par dessus pour effectuer le déplcement.
Private Sub Déplacement_Plateau2()
Indice70 = Indice70 + 1
If Indice2_Image2 = 1 Then
Image70(Indice70).Left = Image2.Left
Image70(Indice70).Top = Image2.Top
Image70(Indice70).Visible = True
Image2.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image4 = 1 Then
Image70(Indice70).Left = Image4.Left
Image70(Indice70).Top = Image4.Top
Image70(Indice70).Visible = True
Image4.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image5 = 1 Then
Image70(Indice70).Left = Image5.Left
Image70(Indice70).Top = Image5.Top
Image70(Indice70).Visible = True
Image5.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image6 = 1 Then
Image70(Indice70).Left = Image6.Left
Image70(Indice70).Top = Image6.Top
Image70(Indice70).Visible = True
Image6.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image7 = 1 Then
Image70(Indice70).Left = Image7.Left
Image70(Indice70).Top = Image7.Top
Image70(Indice70).Visible = True
Image7.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image8 = 1 Then
Image70(Indice70).Left = Image8.Left
Image70(Indice70).Top = Image8.Top
Image70(Indice70).Visible = True
Image8.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image9 = 1 Then
Image70(Indice70).Left = Image9.Left
Image70(Indice70).Top = Image9.Top
Image70(Indice70).Visible = True
Image9.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image10 = 1 Then
Image70(Indice70).Left = Image10.Left
Image70(Indice70).Top = Image10.Top
Image70(Indice70).Visible = True
Image10.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image11 = 1 Then
Image70(Indice70).Left = Image11.Left
Image70(Indice70).Top = Image11.Top
Image70(Indice70).Visible = True
Image11.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image12 = 1 Then
Image70(Indice70).Left = Image12.Left
Image70(Indice70).Top = Image12.Top
Image70(Indice70).Visible = True
Image12.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image14 = 1 Then
Image70(Indice70).Left = Image14.Left
Image70(Indice70).Top = Image14.Top
Image70(Indice70).Visible = True
Image14.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image15 = 1 Then
Image70(Indice70).Left = Image15.Left
Image70(Indice70).Top = Image15.Top
Image70(Indice70).Visible = True
Image15.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image16 = 1 Then
Image70(Indice70).Left = Image16.Left
Image70(Indice70).Top = Image16.Top
Image70(Indice70).Visible = True
Image16.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image17 = 1 Then
Image70(Indice70).Left = Image17.Left
Image70(Indice70).Top = Image17.Top
Image70(Indice70).Visible = True
Image17.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image18 = 1 Then
Image70(Indice70).Left = Image18.Left
Image70(Indice70).Top = Image18.Top
Image70(Indice70).Visible = True
Image18.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image19 = 1 Then
Image70(Indice70).Left = Image19.Left
Image70(Indice70).Top = Image19.Top
Image70(Indice70).Visible = True
Image19.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image20 = 1 Then
Image70(Indice70).Left = Image20.Left
Image70(Indice70).Top = Image20.Top
Image70(Indice70).Visible = True
Image20.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image22 = 1 Then
Image70(Indice70).Left = Image22.Left
Image70(Indice70).Top = Image22.Top
Image70(Indice70).Visible = True
Image22.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image23 = 1 Then
Image70(Indice70).Left = Image23.Left
Image70(Indice70).Top = Image23.Top
Image70(Indice70).Visible = True
Image23.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image24 = 1 Then
Image70(Indice70).Left = Image24.Left
Image70(Indice70).Top = Image24.Top
Image70(Indice70).Visible = True
Image24.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image25 = 1 Then
Image70(Indice70).Left = Image25.Left
Image70(Indice70).Top = Image25.Top
Image70(Indice70).Visible = True
Image25.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image26 = 1 Then
Image70(Indice70).Left = Image26.Left
Image70(Indice70).Top = Image26.Top
Image70(Indice70).Visible = True
Image26.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image28 = 1 Then
Image70(Indice70).Left = Image28.Left
Image70(Indice70).Top = Image28.Top
Image70(Indice70).Visible = True
Image28.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image29 = 1 Then
Image70(Indice70).Left = Image29.Left
Image70(Indice70).Top = Image29.Top
Image70(Indice70).Visible = True
Image29.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image30 = 1 Then
Image70(Indice70).Left = Image30.Left
Image70(Indice70).Top = Image30.Top
Image70(Indice70).Visible = True
Image30.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
If Indice2_Image32 = 1 Then
Image70(Indice70).Left = Image32.Left
Image70(Indice70).Top = Image32.Top
Image70(Indice70).Visible = True
Image32.Visible = False
If Image70(Indice70).Top > Image69(Indice69) Then
Do While Image70(Indice70).Top > Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top - 5
Wait
Loop
End If
If Image70(Indice70).Top < Image69(Indice69).Top Then
Do While Image70(Indice70).Top < Image69(Indice69).Top
DoEvents
Image70(Indice70).Top = Image70(Indice70).Top + 5
Wait
Loop
End If
If Image70(Indice70).Left < Image69(Indice69).Left Then
Do While Image70(Indice70).Left < Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left + 5
Wait
Loop
End If
If Image70(Indice70).Left > Image69(Indice69).Left Then
Do While Image70(Indice70).Left > Image69(Indice69).Left
DoEvents
Image70(Indice70).Left = Image70(Indice70).Left - 5
Wait
Loop
End If
Image69(Indice69).Visible = True
Indice69 = Indice69 + 1
End If
Indice70 = Indice70 - 1
End Sub
cs_snake57
Messages postés204Date d'inscriptionvendredi 19 novembre 2004StatutMembreDernière intervention 1 novembre 2011 22 août 2005 à 21:37
Image2 à image32 n'ont pas été indicé lors de la création du prog.
La je suis entrain de rajouter des fonctions au prog donc plutot que de tous modifier j'ai préférer m'adapter a ce qui avait déjà été fait. Voila pourquoi les images 2 a 32 non pas été indicé.
De plus le code n'a pas été répété 32 fois mais 26 fois (je sais c'est beaucoup quand même)
indice69 et indice70 sont éffectivement déclaré en global. Ceci car je dois les appeler dans une fonction RAZ.
Mais cette fonction n'interfère pas avec le déroulemnt du prog (j'en suis sur).
Durant le fonctionnement, le seul endroit ou est modifié ces indices est cette fonction.
Gobillot
Messages postés3140Date d'inscriptionvendredi 14 mai 2004StatutMembreDernière intervention11 mars 201934 6 sept. 2005 à 17:59
non pas du tout, c'est pas de la multi.
le DoEvents va permettre à windows de traiter ses messages, par exemple
Click sur un Bouton, ton programme s'arrête, les données locales sont
mises sur la pile, l'évênement s'effectue jusqu'au bout (si pas d'autre
évênement), donc ici c'est la dernière image cliquée qui va se déplacer
jusqu'au bout, ensuite les données sont reprises de la pile, et la
première image reprend où elle en était.
si les variables sont
globales, elles sont pas mises sur la pile, et la première image repart
avec des données qui ont été modifiées.
Vb6 c'est un seul thread, un seul programme tourne en même temps.
il n'y a pas d'alternance, pas de découpage de traitement.
le Timer est la seule solution valable, et c'est à toi de le gérer.