LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Listbox focused row when more items selected

Hi, I have following problem. I'm using ListBox with multiple rows selection enabled. I want to identify the row that's focused even when it's not selected. It's shown on attached pictures.

I'll appreciate any kind of help
Bye
jochynator
LV 8.0.1, WinXP Pro
0 Kudos
Message 1 of 6
(4,124 Views)
You use the "value" property node.  This will return an array of row and column.  You can then index the array with an index of 0 for the row and 1 for the column.  This will get the right value for you.


Kenny
Kenny

0 Kudos
Message 2 of 6
(4,109 Views)
Thanks, but this is not what's my problem. I want to know the row that has "focus" - the small dashed line (rectangle) around. Value gives all selected rows. But row with "focus" doesn't need to be selected one - like on example 1.

Message Edited by jochynator on 07-17-2006 03:40 PM

jochynator
LV 8.0.1, WinXP Pro
0 Kudos
Message 3 of 6
(4,103 Views)
Hey jochynator,

Unfortunately there is not a proprety node that will detect which row has focus.  However, there might be a workaround for you, depending on why you need this row.  A row has focus if it is clicked last, so you could use an event structure to determine where that mouse click occurred and then correspond that to a row number.  You could also use a double click since there is a Get Double Click method that allows you to get the row of a double-click.  What is you application of this?  Do these suggestions help?

Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 4 of 6
(4,090 Views)
Hi Andy,
I want to know which item was selected as last to draw the correct datafile - last chosen. It would be easy when having ListBox allowing to select only one row, but I want to have opportunity to select more items, when I want to delete more datafiles from memory.
jochynator
LV 8.0.1, WinXP Pro
0 Kudos
Message 5 of 6
(4,071 Views)
jochynator,

If you wanted to use the "focus" of the listbox, probably the best thing to do would be to keep track of the last set of selected values and the new set of selected values and compare them.  There are only a few different cases when an item will have focus and you can add code to accomidate for that.  Maybe another alternative to using the focus could be to use two listboxes and the built-in drag and drop functionality to adjust the correct list of datafiles.  If you right-click on the listbox you can access the built-in drag and drop settings, which I would highly recommend tinkering with. 

Would this work?  Let me know if you have questions.

Andy F.
-----------------------------------------------------------------
National Instruments
0 Kudos
Message 6 of 6
(4,060 Views)