上下文菜单位于左上角 [英] Context Menu comes at the top left corner

查看:87
本文介绍了上下文菜单位于左上角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我已经为我的datagridview设置了上下文菜单.问题是它总是出现在左上角,而我想在单击鼠标右键的位置显示它.

请告知该怎么做?
谢谢
Furqan

Hi,
I have set a context menu for my datagridview. Problem is it always comes at top left corner while I want to show it at the position where right mouse buttons is being clicked.

Please advise how to do it?
Thanks
Furqan

推荐答案

您如何执行此操作?
我在设计器中添加了DataGridView并适当调整了大小.
在设计器中添加了ContextMenuStrip,设置了一些菜单项.
我将DataGridView的ContextMenuStrip属性设置为ContextMenuStrip

当我运行该应用程序时,该菜单会显示在菜单的左上角,我在该菜单上单击鼠标右键即可.

您在做什么不同的事情?
How are you doing this?
I added a DataGridView in the designer and sized it appropriately.
Added a ContextMenuStrip in the designer, set some menu items.
I set the ContextMenuStrip property of the DataGridView to the ContextMenuStrip

When I run the app, the menu appears with the top left corner of the menu where I right click the mouse.

What are you doing differently?


看看示例
Have a look at the sample here[^].
This may give you an idea as to what you might be missing.


这篇关于上下文菜单位于左上角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆