TreeView Plus Sign to Select Node?

B

B-Dog

I was trying to use the treeview and was wondering if there was a way to
make the treeview select the node when you click the plus sign next to it.
The only way I've found to do it is to actually click on the node name and
then it will show it selected. I'd like to change to selected when you
click the plus sign. Is this possible. Thanks
 
H

Herfried K. Wagner [MVP]

B-Dog said:
I was trying to use the treeview and was wondering if there was a way to
make the treeview select the node when you click the plus sign next to it.
The only way I've found to do it is to actually click on the node name and
then it will show it selected. I'd like to change to selected when you
click the plus sign.

\\\
Private Sub TreeView1_ExpandOrCollapse( _
ByVal sender As Object, _
ByVal e As TreeViewEventArgs _
) Handles TreeView1.AfterCollapse, TreeView1.AfterExpand
Me.TreeView1.SelectedNode = e.Node
End Sub
///
 
B

B-Dog

Thanks, will try that!

Barclay

Herfried K. Wagner said:
\\\
Private Sub TreeView1_ExpandOrCollapse( _
ByVal sender As Object, _
ByVal e As TreeViewEventArgs _
) Handles TreeView1.AfterCollapse, TreeView1.AfterExpand
Me.TreeView1.SelectedNode = e.Node
End Sub
///
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top