By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,515 Members | 1,061 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,515 IT Pros & Developers. It's quick & easy.

get selected node from mouse right click

P: n/a
hi, the treeview only selects a tree node when clicked with the left mouse
button...how can i get it to select a node with the right mouse button?

thanks
--
-iwdu15
Apr 3 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
In the mousedown , you can use e.x and e.y along with HitTest method to get
the nodeclicked... I don't have the exact code in the pile I have here... I
found a sample from CodeProject to use.. you check the site out...

Vijay

"iwdu15" <jmmgoalsteratyahoodotcom> wrote in message
news:5F**********************************@microsof t.com...
hi, the treeview only selects a tree node when clicked with the left mouse
button...how can i get it to select a node with the right mouse button?

thanks
--
-iwdu15

Apr 3 '06 #2

P: n/a
Iwdu15

Was you not using version 2005

http://msdn2.microsoft.com/en-us/lib...ck(VS.80).aspx

Cor
Apr 4 '06 #3

P: n/a
Here is how you do in version 1.1.. and 2003
If e.Button = MouseButtons.Right Then
Dim currNode As TreeNode
Dim ClickPoint As Point = New Point(e.X, e.Y)
currNode = TreeViewControl1.GetNodeAt(ClickPoint)
If currNode Is Nothing Then
Return
End If
If Not TypeOf currNode.Tag Is TreeTag Then
Return
End If
End If

VJ

"iwdu15" <jmmgoalsteratyahoodotcom> wrote in message
news:5F**********************************@microsof t.com...
hi, the treeview only selects a tree node when clicked with the left mouse
button...how can i get it to select a node with the right mouse button?

thanks
--
-iwdu15

Apr 4 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.