This isn't rocket science. You want to know which node was clicked. So, you
want to handle the Click event of the TreeView Control. The only time you
can handle this event is when the mouse is clicked. The MouseEventArgs
passed to the event will tell you the coordinates of the mouse. You then use
those coordinates with the HitTest or the GetNodeAt method, passing those
coordinates to the method, to obtain a reference to the node that was
clicked.
See:
http://msdn2.microsoft.com/en-us/lib....treeview.aspx
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
Sequence, Selection, Iteration.
"Alan T" <al*************@yahoo.com.auwrote in message
news:OQ**************@TK2MSFTNGP02.phx.gbl...
Should I call this hittest method when the mouse is right clicked ?
"Kevin Spencer" <uc*@ftc.govwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>Yes, of course. You call the HitTest method of the TreeView.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
What You Seek Is What You Get.
"Alan T" <al*************@yahoo.com.auwrote in message
news:u4*************@TK2MSFTNGP04.phx.gbl...
>>Are you saying by calling the HitTest when I right click the node ?
"Kevin Spencer" <uc*@ftc.govwrote in message
news:O%*****************@TK2MSFTNGP04.phx.gbl. ..
Use the HitTest method to get the node that was clicked.
--
HTH,
Kevin Spencer
Microsoft MVP
Professional Chicken Salad Alchemist
What You Seek Is What You Get.
"Alan T" <al*************@yahoo.com.auwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl. ..
Can I find out which node was right clicked on a treeview?
>