Treeview.selecteditem<> Nothing...

sonoboss Messages postés 178 Date d'inscription lundi 17 juin 2002 Statut Membre Dernière intervention 2 octobre 2007 - 23 mai 2004 à 20:38
sonoboss Messages postés 178 Date d'inscription lundi 17 juin 2002 Statut Membre Dernière intervention 2 octobre 2007 - 24 mai 2004 à 22:41
Bonsoir,

J'utilise un treeview et je voudrais savoir comment controler si la propriété selecteditem est égale a qqc ( ou plus exactement si cette valeur est différente de Nothing...)

Ps J'ai déja essayé =Nothing... Bien essayé :big)

Merci d'avance !

4 réponses

alicvb Messages postés 134 Date d'inscription vendredi 19 mars 2004 Statut Membre Dernière intervention 6 juin 2007 1
23 mai 2004 à 21:31
Si il n'y a rien de sélectionné dans ton treeview, alors selectedindex=-1 (c'est peu-être plus simple)

sinon, en vb.net (et peut être en vb) pour tester avec nothing, il faut utiliser IS :
if item is nothing then
if not item is nothing then

J'espère que cela répond à ta question...
0
crenaud76 Messages postés 4172 Date d'inscription mercredi 30 juillet 2003 Statut Membre Dernière intervention 9 juin 2006 28
24 mai 2004 à 10:09
Alicvb < Je confirme l'utilsiation de l'opérateur "Is" avec Nothing en VB6
Sonoboss < Comme le dit Alicvb, l'utilisation de la propriété SelectedIndex est recommandé pour ton cas.

Christophe R.
0
sonoboss Messages postés 178 Date d'inscription lundi 17 juin 2002 Statut Membre Dernière intervention 2 octobre 2007
24 mai 2004 à 22:34
Thx a Lot, je vais tester ca.
0
sonoboss Messages postés 178 Date d'inscription lundi 17 juin 2002 Statut Membre Dernière intervention 2 octobre 2007
24 mai 2004 à 22:41
Confirmé, ca marche impecablement.
0
Rejoignez-nous