-
February 26th, 2002, 09:05 AM
#1
CheckBox in Treeview
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.
-
February 26th, 2002, 03:01 PM
#2
Re: CheckBox in Treeview
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
-
February 26th, 2002, 11:49 PM
#3
Re: CheckBox in Treeview
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.
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
|