Pb VB

sandy -  
teebo Messages postés 33491 Date d'inscription   Statut Modérateur Dernière intervention   -
Bonjour,

Je developpe en vb et j'ai un gros bug.
J'ai une liste (TList) de questions en sélection multiple ext. et je veux savoir combien d'élements la personne selectionne. J'ai fait cette fonction :
Private Sub Liste_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)

If Liste.SelItemCount = 1 Then

Apercu.text = Right(Liste.List(Liste.SelItemIndex(0)), Len(Liste.List(Liste.SelItemIndex(0))) - InStr(Liste.List(Liste.SelItemIndex(0)), "- ") - 1)

Else

Apercu.text = "Aperçu"

End If

End Sub

Le problème c que quand j'utilise la souris ou shift la fonction Liste.SelItemCount me retourne tj 1.

Si je mais un msgbox ou un point d'arret par contre ca marche bien...Je sais pas quoi faire qqun a une idée?



Merci d'avance

Sandy
A voir également:
  • Pb VB
  • Vb - Télécharger - Langages
  • Vb cable - Télécharger - Audio & Musique
  • Vb editor - Télécharger - Langages
  • Vb runtime - Télécharger - Divers Utilitaires
  • Vb express - Télécharger - Langages

1 réponse

teebo Messages postés 33491 Date d'inscription   Statut Modérateur Dernière intervention   1 793
 
Pas tout regarder en detail mais si tu mets Liste.SelItemCount >0 a la place de Liste.SelItemCount = 1?
ö,ö
\_/
0