TreeView node checking 
Author Message
 TreeView node checking

Does anyone know how check a TreeView node to see which
node was clicked? Any and all examples are welcome.

Thanks!
Bob
.



Sat, 29 Oct 2005 12:00:05 GMT  
 TreeView node checking
Hi Bob,

Quote:
> Does anyone know how check a TreeView node to see which
> node was clicked? Any and all examples are welcome.

when you drop a treeview list on a form you also get a number of events
associated with it in your project. One of them is:

Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)

With Node you can do whatever you'd like, like requesting which key it
belongs to or what text it has! (actually, it's just a node-object so
you can request all of its properties)

Richard



Sat, 29 Oct 2005 15:39:16 GMT  
 TreeView node checking
Hi Bob,

In addition to the node_click event you can check in code easily enough:

Dim myNode As Node

    Set myNode = TreeView1.SelectedItem
    MsgBox myNode.Key

HTH,

Simon


Quote:
> Hi Bob,

> > Does anyone know how check a TreeView node to see which
> > node was clicked? Any and all examples are welcome.

> when you drop a treeview list on a form you also get a number of events
> associated with it in your project. One of them is:

> Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)

> With Node you can do whatever you'd like, like requesting which key it
> belongs to or what text it has! (actually, it's just a node-object so
> you can request all of its properties)

> Richard



Sat, 29 Oct 2005 20:20:10 GMT  
 TreeView node checking

Tue, 13 May 2003 20:20:10 +0800 bearing the following fruit:

Quote:
>Hi Bob,

>In addition to the node_click event you can check in code easily enough:

>Dim myNode As Node

>    Set myNode = TreeView1.SelectedItem
>    MsgBox myNode.Key

>HTH,

>Simon

However, if there is no selecteditem then that code will
generate an error. It's always wise to check this before
using .Selecteditem.

J

Quote:


>> Hi Bob,

>> > Does anyone know how check a TreeView node to see which
>> > node was clicked? Any and all examples are welcome.

>> when you drop a treeview list on a form you also get a number of events
>> associated with it in your project. One of them is:

>> Private Sub TreeView1_NodeClick(ByVal Node As MSComctlLib.Node)

>> With Node you can do whatever you'd like, like requesting which key it
>> belongs to or what text it has! (actually, it's just a node-object so
>> you can request all of its properties)

>> Richard

--

Nostalgia is like a grammar lesson: You find the present tense and the past perfect. (Catherine Shoemaker)



Sat, 29 Oct 2005 22:29:42 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Treeview node check bug.

2. TreeView Nodes.Checked

3. Treeview.node().checked property

4. TreeView Checked Node?

5. Traversing TreeView, but only checked nodes?

6. TreeView Control - Checked property of Node not working

7. Treeview check if node exists

8. Preventing Nodes from being checked in the Treeview Control

9. VB6 TreeView Control Node Check

10. Recursive checking of a treeview node

11. TreeView-ListView Showing Nodes as "Checked"

12. treeview node count not incrementing when adding new nodes

 

 
Powered by phpBB® Forum Software