NI LabVIEW,CVI,数据采集等产品讨论区

取消
显示结果 
搜索替代 
您的意思是: 

关于Table Control的右键菜单使用问题

Table Control可以自定义右键菜单,但是定以后如何使用呢?我最初想可能要Creat一个Table Control的Menu Refrence,但我找了半天没有。使用这样的菜单是不是和使用自定义程序菜单用一样的方式呢?如果是的话,Table Control的Menu Refrence就是问题的关键。哪位大侠能帮帮我吗?
0 项奖励
1 条消息(共 8 条)
7,125 次查看

It is LV8.0's new function, use event case to get the menu tag.

see enclosed

 

________________________________________________________


Try to make everything Automatic
2 条消息(共 8 条)
7,115 次查看
Thank you very much,Yukee.Yang.The problem has puzzled me long time,you point to me the right way and I solve my question at the end. Thank you again.
0 项奖励
3 条消息(共 8 条)
7,107 次查看
I have a new question when I used the new function.Show in the above picture,I want to delete the data that selected by the right click,but event case don't return which row selected,and event case don't have "right click" event. How I should do to get the right clicked row?
0 项奖励
4 条消息(共 8 条)
7,090 次查看
is it your need ?
________________________________________________________


Try to make everything Automatic
0 项奖励
5 条消息(共 8 条)
7,075 次查看
Thank you ,Yukee.Yang. But I want to get the row or column just by right click. don't need to confirm by left click before use short menu. Thank you for help me,best wishes for you!
0 项奖励
6 条消息(共 8 条)
7,069 次查看
Yes, it can, but you have to do something (maybe complex), get mouse position, and shape it....
but, I don't understand its that status is trouble or not good ?
________________________________________________________


Try to make everything Automatic
0 项奖励
7 条消息(共 8 条)
7,057 次查看
呵呵,这次我就用汉语回帖吧。
 
其实我想做的是让程序与一般的windows程序相似,仅以右键就可确定选项并弹出菜单。在使用时如果要先用左键确定,给人很不习惯。如果右键不能确定选项,这样容易产生误删(这是我最担心的)。
 
我想了一下,可以通过比较复杂的方法实现,正如Yukee.Yang所说:获取鼠标位置,获取Table Control的位置,再获取行和列的高宽度,通过这样一个公式:
      Table Control的位置-鼠标位置)/行或列的高宽度
 
即可得知鼠标右键点在哪行哪列。但是这牵涉到很多细节问题不说,还有一个bug,如果使用者拉动了滚动条,那么计算出的行或列就变得不准确了。因此这种方法也有缺陷。不知道是否有更好更正确的方法来解决这一问题。
0 项奖励
8 条消息(共 8 条)
7,041 次查看