Information générale
Catégorie:
Contrôles ActiveX en VFP
Titre:
The problem about seek nodes in treeview
Hi, dear all
When I use the TreeView ActiveX control in my form,I met a strange thing. After I added a node into tree, then seek this node immediately, the system report the node not exist. That's why. Following is my codes. Thanks anyway.
loOleTree=This.Parent.Treeview
loOleTree.imagelist = Thisform.ImagesList.Object
loOleTree.Nodes.Clear
If !Empty(lsBR)
Select Cate2Class.Category_ID,Category_Name,Class_Name,Class2BRand.Class_ID;
From Categories,Cate2Class,Classes,Class2BRand,Brands;
WHERE Alltrim(Cate2Class.Category_ID)==Alltrim(Categories.Category_ID) And Alltrim(Cate2Class.Class_ID)==Alltrim(Classes.Class_ID);
AND Alltrim(Class2Brand.Class_ID)==Alltrim(Cate2Class.Class_ID) And Alltrim(Class2Brand.Brand_ID)==Alltrim(Brands.Brand_ID) And Alltrim(Brand_Name)==Alltrim(lsBR) ;
ORDER BY Cate2Class.Category_ID, Cate2Class.Class_ID;
INTO Cursor lcrTMP
If _Tally!=0
Select lcrTMP
lsCT=""
Scan All
IF ALLTRIM(Category_ID)!=ALLTRIM(lsCT)
loOleTree.Nodes.Add(,2, Category_ID, Category_Name,"CloseBook","OpenBook")
ENDIF
loNode=loOleTree.Nodes(Category_ID)
lsCT=Alltrim(Category_ID)
loOleTree.Expand(loNode)
loOleTree.Nodes.Add(loNode,4,Class_ID,Class_Name,"CloseBook","OpenBook")
Endscan
Use
Endif
Endif
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement