473,491 Members | 2,583 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

get selected node from mouse right click

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
3 2552
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
Iwdu15

Was you not using version 2005

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

Cor
Apr 4 '06 #3
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2112
by: worzel | last post by:
Can't suss this out for the life of me, googling of no help either. Okay, new to win forms; I have a treeview with several root nodes, each having a single level of child nodes underneath. I also...
3
7592
by: Manish Jain | last post by:
Platform: C# Windows Application/Framework 1.1 ---------------------------------------------------- I am implementing Drag' Drop between 2 trees. Now when I initiate drag and "DragOver" the...
4
11569
by: Phill | last post by:
Here's what I'm doing to make the right context mnue show up based on what node was cliked: private void tvwMenu_MouseUp(object sender, MouseEventArgs e) { //Select Node When Right Clicked &...
4
7796
by: Tom | last post by:
Hello everyone, I found a frustrating behavior in the TreeView control in .NET 2.0. The TreeNode that is passed in the TreeNodeMouseClickEventArgs is incorrect when the TreeView automatically...
6
1907
by: Alan T | last post by:
Can I find out which node was right clicked on a treeview?
1
9814
by: Alan T | last post by:
I selected a node in treeview, however, if I right click another node and after exited the pop up menu this "right clicked" node is not selected. How do I make this "right clicked" node is selected...
2
2405
by: rfm | last post by:
I have a TreeView with 1 expanded top node, it has several childnodes (call it row A), which have childs of their own. The top node is selected correctly and all childnodes from the row A nodes...
2
3710
by: Claire | last post by:
I've a treeview control containing a root node with several children on a windows form. I select a node with a left mouse button click. I then select one of the other nodes with right mouse click...
0
3272
by: divya1949 | last post by:
Create a windows c# application which will Read a xml file and populate nodes in the treeview. 1 On selection of treenode display the child nodes of that node in listview control 2. ...
0
7146
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7183
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6852
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7356
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5448
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4878
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
628
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
277
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.