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

Tree control selection

已解决!
转到解答

OK, so this should be somewhat straightforward, but I am unable to find how to do this.  I want to fire an event when I select an element in a tree control and then determine which element was selected.  Right now I can use the double-click function in the invoke node associated with the tree control, but there seems to be no way to determine what row currently has focus.  Thoughts?

0 项奖励
1 条消息(共 8 条)
5,566 次查看

Why not just use an event structure to capture the current value?  Maybe I am not understanding your question.

Capture.PNG

aputman
0 项奖励
2 条消息(共 8 条)
5,530 次查看

Nothing is changing - I simply want what the user has selected (not entered or changed). 

0 项奖励
3 条消息(共 8 条)
5,523 次查看
解答
接受人 cirrusio

wrote:

Nothing is changing - I simply want what the user has selected (not entered or changed). 


Ok...that's the value change event, exactly what I show in the pic.  There is a double click event, item open event, etc.  See attached for a few examples.  If this doesn't help you any, please be more specific with your question.  

 

aputman
4 条消息(共 8 条)
5,521 次查看

So, something to note here for posterity.  The value change event does not work this way with the silver tree control. 

0 项奖励
5 条消息(共 8 条)
5,466 次查看

@cirrusio wrote:

So, something to note here for posterity.  The value change event does not work this way with the silver tree control. 


I'm not sure what makes you think so.  I just tested it on LV2016 and value change event does fire for a silver tree control.

0 项奖励
6 条消息(共 8 条)
5,457 次查看

@cirrusio wrote:

So, something to note here for posterity.  The value change event does not work this way with the silver tree control. 


It works exactly the same way in Labview 2012 and 2017.  Show me what you mean.  Share some code showing otherwise.  

 

Right click the tree -> Selection Mode.  Do you have Allow Selection of Parent Items unchecked?

aputman
0 项奖励
7 条消息(共 8 条)
5,456 次查看

You are correct - it is working on 2016.  It is not working on 2013 from what I recall (I had to change to modern to get it to fire on selection).

0 项奖励
8 条消息(共 8 条)
5,452 次查看