Found another solution too.
private void treeView1_MouseDown(object sender,
System.Windows.Forms.MouseEventArgs e)
{
if(MouseButtons.Right)
{
TreeNode node = treeView1.GetNodeAt(e.X, e.Y);
....
}
}
"Nicholas Paldino [.NET/C# MVP]" wrote:
[color=blue]
> Hylton,
>
> In .NET 2.0, you can call the HitTest method on the TreeView to get a
> TreeViewHitTestInfo class instance which will have the node that the point
> passed to the HitTest method points to (if there is one).
>
> If not in .NET 2.0, you will have to call SendMessage through the
> P/Invoke layer, passing the TV_HITTESTINFO message to get the location of
> the the node at the specified coordinates.
>
> Hope this helps.
>
>
> --
> - Nicholas Paldino [.NET/C# MVP]
> -
mvp@spam.guard.caspershouse.com
>
> "Hylton" <Hylton@discussions.microsoft.com> wrote in message
> news:A30A65CE-A625-4265-B20C-777F1919DA65@microsoft.com...[color=green]
> > Hi
> >
> > In a treeview How do I get the node that the user right clicked on. I need
> > to modify the contecxt menu based on the node
> >
> >
> >
> >[/color]
>
>
>[/color]