Delphi 弹出菜单可见性
Delphi 7 有没有办法确定弹出菜单是否可见(显示在屏幕上),因为它缺少 Visible 属性。
Is there a way in Delphi 7 to find out if a pop-up menu is visible (shown on the screen) or not, since it lacks a Visible property.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以通过在 OnPopup 事件中设置它来制作自己的标志。 问题是知道弹出菜单何时关闭。 彼得·下面有一个解决方案。
但我问你为什么想要这个? 也许有更好的方法来解决根本问题。
You could make your own flag by setting it in the OnPopup event. The problem is knowing when the popupmenu is closed. Peter Below has a solution for that.
But my I ask why you would want this? Maybe there is a better way to solve the underlying problem.
这似乎更简单一些(我使用Delphi 2007):
在你的WM_CONTEXTMENU消息处理程序中,在调用继承的处理程序之前,弹出菜单即将显示,你可以设置你的标志。 调用inherited后,弹出菜单已经关闭,重置你的flag。
This seems to be a bit simpler (I used Delphi 2007):
In your WM_CONTEXTMENU message handler, before calling the inherited handler, the popup menu is about to be shown, you can set your flag. After calling inherited, the popup menu has been closed, reset your flag.