Steve,
I don't believe so. The Show method expects the Point parameter to be
in relation to the control that is passed in for the control parameter.
When you get X and Y from the MouseEventArgs instance in your event
handler, they are in the coordinates of the treeview already (assuming that
the event handler is for the tree view). Because of this, you want to omit
the call to PointToClient, and then pass screenPoint directly to the Show
method of the context menu.
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
"SteveK" <as***@asdfasdfsd.com> wrote in message
news:Oc**************@TK2MSFTNGP09.phx.gbl...
Shouldn't this code put the menu in the same location as my cursor?
Point screenPoint = new Point(e.X, e.Y);
Point formPoint = treeView1.PointToClient(screenPoint);
Tree_ContextMenu.Show(this, formPoint);
I'm getting it above the cursor. From whay I read on MSDN about
pointToClient it shoud do what I want... but it's not. Any ideas?
Thanks,
Steve