分配给多个控件所有者问题的VB.net(桌面)上下文菜单 [英] VB.net (desktop) context menu assigned to multiple controls owner problem

查看:109
本文介绍了分配给多个控件所有者问题的VB.net(桌面)上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在同一表格上有两个不同的网格控件。它们共享相同的上下文菜单。选择上下文菜单项时,我无法确定哪个控件是所有者。

I have two different grid controls on the same form. They share the same context menu. I am having trouble determining which control is the owner when I select the context menu item.

推荐答案

ContextMenuStrip类的SourceControl属性将显示导致该菜单条显示的最后一个控件。

SourceControl property on the ContextMenuStrip class will show the last control that caused that menu strip to be shown.

这篇关于分配给多个控件所有者问题的VB.net(桌面)上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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