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
(4,483 Views)

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

Capture.PNG

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 2 of 8
(4,447 Views)

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

0 Kudos
Message 3 of 8
(4,440 Views)
Solution
Accepted by 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
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 4 of 8
(4,438 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
(4,383 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
(4,374 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
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
0 Kudos
Message 7 of 8
(4,373 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
(4,369 Views)