How do i set checked property of a TreeView Node to true.
The following is not working...
Dim tvNode as Node
Set tvNode = fMainForm.tvTreeView.Nodes.Add(,,, "Text",1)
tvNode.Checked = True
any ideas?
Thanks.
Printable View
How do i set checked property of a TreeView Node to true.
The following is not working...
Dim tvNode as Node
Set tvNode = fMainForm.tvTreeView.Nodes.Add(,,, "Text",1)
tvNode.Checked = True
any ideas?
Thanks.
This works for me. I have used two methods for setting checkboxes. Note the tv.Checkboxes = True must come before the attempt to set a checkmark or it will fail.
private Sub Form_Load()
Dim nx as Node
tv.Checkboxes = true
set nx = tv.Nodes.Add(, , "Root", "Root")
nx.Checked = true '--> Method Number one
tv.Nodes.Add "Root", tvwChild, "A1", "A1"
tv.Nodes.Add "Root", tvwChild, "A2", "A2"
tv.Nodes("A2").Checked = true ' Method NUmber Two
tv.Nodes("Root").Expanded = true
End Sub
Please rate it if it answers the question
or is useful.
'
John G
Thanks for the reply.
It works fine if any Imagelist is not linked with treeview. If i try to load any image to the node along with the checkbox, it fails...
I want to load both Checkbox and the image.
any idea?
Thanks.