开发者

Show the ContextMenuStrip on the correct location of ActiveX control

I have an ActiveX control (VB 6.0) th开发者_StackOverflow中文版at 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)));


Try this:

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜