|
-
Jan 4th, 2010, 04:26 AM
#1
Thread Starter
Addicted Member
-
Jan 4th, 2010, 08:43 AM
#2
Frenzied Member
Re: Treeview Requirement in vb6
This might be a dumb question, but if you are populating the children, can you not count the children prior to adding the parent node (since you have this information) and add the count to the string you use for display, or go back and edit the string???
Good Luck
Option Explicit should not be an Option!
-
Jan 4th, 2010, 10:45 AM
#3
Re: Treeview Requirement in vb6
Is this what you want?
Code:
Option Explicit
Private Const TVM_GETCOUNT = &H1105&
Private Declare Function SendMessage Lib "user32" Alias _
"SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal _
wParam As Long, lParam As Any) As Long
Private Sub Form_Load()
Dim lngCnt As Long, nodX As Node
Set nodX = TreeView1.Nodes.Add(, , "R", "Root")
For lngCnt = 1 To 5
'~~> Adding 5 Sample Nodes
Set nodX = TreeView1.Nodes.Add("R", tvwChild, "C" & lngCnt, _
"Child " & lngCnt)
Next
End Sub
Private Sub Command1_Click()
Dim NodesCount As Long
'~~> Get Total Node count including treeview parent node
NodesCount = SendMessage(TreeView1.hwnd, TVM_GETCOUNT, 0, ByVal 0)
'~~> Update Text of the parent code
TreeView1.Nodes.Item(1).Text = TreeView1.Nodes.Item(1).Text & " (" & (NodesCount - 1) & ")"
End Sub
A good exercise for the Heart is to bend down and help another up...
Please Mark your Thread " Resolved", if the query is solved
MyGear:
★ CPU ★ Ryzen 5 5800X
★ GPU ★ NVIDIA GeForce RTX 3080 TI Founder Edition
★ RAM ★ G. Skill Trident Z RGB 32GB 3600MHz
★ MB ★ ASUS TUF GAMING X570 (WI-FI) ATX Gaming
★ Storage ★ SSD SB-ROCKET-1TB + SEAGATE 2TB Barracuda IHD
★ Cooling ★ NOCTUA NH-D15 CHROMAX BLACK 140mm + 10 of Noctua NF-F12 PWM
★ PSU ★ ANTEC HCG-1000-EXTREME 1000 Watt 80 Plus Gold Fully Modular PSU
★ Case ★ LIAN LI PC-O11 DYNAMIC XL ROG (BLACK) (G99.O11DXL-X)
★ Monitor ★ LG Ultragear 27" 240Hz Gaming Monitor
★ Keyboard ★ TVS Electronics Gold Keyboard
★ Mouse ★ Logitech G502 Hero
-
Jan 4th, 2010, 10:49 AM
#4
Thread Starter
Addicted Member
Re: Treeview Requirement in vb6
Hi!
milions of Thanks to you it worked....
with regards!
Sethuraman R
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
|