[vb.net]indexof d'un objet dans un arraylist
Bonsoir,
J'ai un arraylist arRule que je rempli avec 3 objets de type clsFormat
Code:
1 2 3 4 5 6 7 8
| Dim arRule as arraylist
dim newFormat as New clsFormat("0010","TOTO")
arRule.add(newFormat)
dim newFormat2 as New clsFormat(("0020","TITI")
arRule.add(newFormat2)
dim newFormat3 as New clsFormat(("0030","TUTU")
arRule.add(newFormat3) |
clsFormat comprend 2 propriétés
clsFormat.MyId et clsFormat.Libel
je sais par exemple afficher un élément de mon arraylist
en écrivant
Code:
Msgbox( DirectCast(arRule.Item(2),newFormat).Libel)
qui me retournera "TUTU"
mais comment trouver l'index de arRule qui contient l'objet newFormat qui à MyId ="0030"
Merci d'avance