jmf0
Messages postés1566Date d'inscriptionmardi 26 décembre 2000StatutMembreDernière intervention 5 avril 20138 28 janv. 2009 à 20:28
Bonjour,
Je ne vois pas l'intérêt de savoir si on avait déjà cliqué ou non un article ...
Mais bon ...
Voilà donc, en espérant que tu développes biens sous VB6 (le présent thème) et non sous VBA (MsOffice) :
Private Sub List1_Click()
Static toto As Integer If toto 0 Then toto List1.ListIndex: Exit Sub
If List1.Selected(toto) = True Then MsgBox "déjà cliqué"
toto = List1.ListIndex
End Sub
jmf0
Messages postés1566Date d'inscriptionmardi 26 décembre 2000StatutMembreDernière intervention 5 avril 20138 28 janv. 2009 à 20:35
Re,
Excuse (je n'avais pas prévu le cas où le premier sélectionné serait le 1er de la liste) ...
On corrige donc :
Private Sub List1_Click()
Static toto As Integer, titi As Boolean If List1.ListIndex -1 Or Not titi Then titi Not titi: Exit Sub
If List1.Selected(toto) = True Then MsgBox "déjà cliqué"
toto = List1.ListIndex
End Sub