Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Treeview Remove
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00419374
Message ID:
00419377
Vues:
24
Are you sure that node exist? When you remove some node, other nodes' indexes shifted. So last node index no longer valid.

>I'm trying to remove all the sibling nodes in a treeview and I keep getting the error "Unknown Name" on the Remove line.
>
>
oParentNode = toNode.PARENT
>iNodeIndex = oParentNode.FirstSibling.INDEX
>
>DO WHILE .T.
>	IF iNodeIndex <> oParentNode.LastSibling.INDEX
>		THISFORM.oTree.Nodes(iNodeIndex).REMOVE && Error occurs here
>		iNodeIndex  = THISFORM.oTree.Nodes(iNodeIndex ).NEXT.INDEX
>	ELSE
>		THISFORM.oTree.Nodes(iNodeIndex).REMOVE
>		EXIT
>	ENDIF
>ENDDO
>
>Can anybody see what I'm doing wrong? TIA
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform