使 PopupMenu 出现在 VB6 中 TreeView 的选定项上
我在VB6中有一个TreeView,当右键单击节点时,它使用PopupMenu。由于 VB6 PopupMenu 默认其位置为鼠标坐标,因此菜单出现在正确的位置。
我想要完成的是,当选择 TreeView 节点时,Popupmenu 也会出现在 KeyDown 事件的正确位置。我该怎么做?
I hava a TreeView in VB6 that uses a PopupMenu when a Node is right clicked. As the VB6 PopupMenu defaults its position to the mouse coordinates the menu appears at the right place.
What I want to accomplish is that the Popupmenu appears at the right place too on a KeyDown event when a TreeView Node is selected. How can I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要获取该项目的坐标。为此,您需要首先获取其句柄。当你得到矩形时,你必须将它转换为坐标。
用法:
You need to obtain coordinates of the item. For that you need to first obtain its handle. And when you get the rect, you must translate it to form coordinates.
Usage: