开发者

Show the ContextMenuStrip on the correct location of ActiveX control

开发者 https://www.devze.com 2023-01-06 19:13 出处:网络
I have an ActiveX control (VB 6.0) th开发者_StackOverflow中文版at I am using in C# and its right click \"e\" param has

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

精彩评论

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

关注公众号