|
-
Oct 11th, 2000, 03:40 PM
#1
Thread Starter
Lively Member
I am using tree view to display hierarchical data. I am using the tree view style 7 that displays text, plus minus, and a picture.
My problem is that plus and minus only displays if the node contain a child node but only after you actually populate the node.
What I have done up to now is to perform a function "CheckForChild" for each node as it populates which checks to see if there are any futher children and then sets the display of the picture icon to show that there are children.
What I want to do is to display the 'plus' sign instead.
The only way I seem to be able to do this is to pouplate the entire tree and then collapse it however I only want to populate each level as it is displayed as it is a database recordset and the levels can run very deep and I don't want to load up the entire recordset.
Any thoughts...Any one...??
-
Oct 11th, 2000, 04:02 PM
#2
Member
Set the image/+, - properties of the file treeview, then populate it like this:
Dim iFileNum As Integer
Dim strParentName As String
Dim strChildName As String
tvwMain.Nodes.Clear
dlgFileOpenClose.CancelError = True
strFileName = "\nameofdatafile.txt"
iFileNum = FreeFile
Open strFileName For Input As #iFileNum
Input #iFileNum, strChildName, strParentName
Call AddRootNode(strChildName)
While Not EOF(iFileNum)
Input #iFileNum, strChildName, strParentName
Call AddNode(strChildName, strParentName)
Wend
Close #iFileNum
' The following line expands the first branch
tvwMain.Nodes(1).Expanded = True
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|