LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tree control selection

Solved!
Go to solution

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 Kudos
Message 1 of 8
(5,423 Views)

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

Capture.PNG

aputman
0 Kudos
Message 2 of 8
(5,387 Views)

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

0 Kudos
Message 3 of 8
(5,380 Views)
Solution
Accepted by topic author 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
Message 4 of 8
(5,378 Views)

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

0 Kudos
Message 5 of 8
(5,323 Views)

@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 Kudos
Message 6 of 8
(5,314 Views)

@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 Kudos
Message 7 of 8
(5,313 Views)

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 Kudos
Message 8 of 8
(5,309 Views)