在 ActiveX 控件的正确位置显示 ContextMenuStrip

发布于 2024-09-08 16:01:44 字数 280 浏览 0 评论 0原文

我有一个在 C# 中使用的 ActiveX 控件 (VB 6.0),其右键单击“e”参数有 int ex 和 int ey 现在我想显示该控件的上下文菜单条。它显示但不是在我右键单击鼠标的确切位置,它比我右键单击的位置高一些。

我写了这样的东西来解决位置问题,但没有解决它。

想法?我应该写什么才能将正确的位置发送给它?

m_contextPopup.Show(myActivexContorl.PointToClient(new Point(x, y)));

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)));

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

甜心小果奶 2024-09-15 16:01:44

试试这个:

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

Try this:

m_contextPopup.Show(
    myActivexContorl,
    myActivexContorl.PointToClient( Form.MousePosition ) );
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文