views:

24

answers:

1

I have an ActiveX control (VB 6.0) that I am using in C# and its right click "e" param has int e.x and int e.y now I want to show the contextmenustrip for this contorl. It is showing but not at the exact location that I right click the mouse, it is some point higher that where I do the right click.

I wrote something like this to fix the location problem, did not fix it.

Thoughts? what should I write to send the correct location to it?

m_contextPopup.Show(myActivexContorl.PointToClient(new Point(x, y)));
+1  A: 

Try this:

m_contextPopup.Show(
    myActivexContorl,
    myActivexContorl.PointToClient( Form.MousePosition ) );
danbystrom