[D7] Treeview: image par défaut
Bonjour à tous,
J'ai un treeview et une image différente à chaque noeud (selon certaines conditions).
Au chargement, tout est bon sauf le premier car c'est celui qui est sélectionné...
En fait, je me suis rendu compte que lorsqu'on changeait la sélection, il changeait l'icone du noeud sélectionné pour mettre le premier de l'imageliste.
Comment changer ce comportement ?
Voici comment je construit mon noeud:
Code:
1 2 3 4 5 6 7
| if txtLieu='' then begin
Arbre := tvMain.Items.Add(nil,'Lieu inconnu: "'+txtIdLieu+'"');
Arbre.ImageIndex := 1;
end else begin
Arbre := tvMain.Items.Add(nil,txtLieu);
Arbre.ImageIndex := 0;
end; |