LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multicolumn Listbox Active Cell

Is there a way to GET the Active Cell in a Multicolumn Listbox? The value of the Multicolumn Listbox gives the row, but I want the column. The Active Cell in Property Node can SET the Active Cell but it doesn't seem to GET it.

Thanks!
Doug
0 Kudos
Message 1 of 14
(8,777 Views)
Hi DBM,
Most properties can be either read or write. On your property node, select active cell, right click on the property node and choose 'change to write'. This will give you the co-ordinates of the cell as a cluster which you can unbundle to obtain the column number.
0 Kudos
Message 2 of 14
(8,768 Views)
Thanks, David, but that doesn't work. The values stay at (0,0) no matter where you click on the listbox.
Message 3 of 14
(8,763 Views)
Clicking inside a cell does not make it active. I think you may have to use an event structure with a mouse down event and calculate where you clicked. This will be affected by the label, the top left cell, the column width and so on.

___________________
Try to take over the world!
0 Kudos
Message 4 of 14
(8,750 Views)
Well, that stinks!

Thanks!
Message 5 of 14
(8,739 Views)
Instead of the multi-column listbox, can you use the table instead? The Edit Position property will return the cell you click in and the contents are populated the same way as a 2D string array.
Message 6 of 14
(8,734 Views)
Yes, thanks for that idea. The silly reason I don't like the table is the shape of the pointer. It makes a user think that he should type something in the cell.

Anyway, thanks for the suggestion.
0 Kudos
Message 7 of 14
(8,731 Views)
I've used a multicolumn listbox in one of my recent programs, which was populated with row and column information from a data file. Clicking the listbox highlights an entire row, and I use the "Value" property to return which row is selected. Did you try the Value property before the Active Cell property?
0 Kudos
Message 8 of 14
(8,726 Views)
I'm actually interested in finding the column of the cell. So yes, the value gives you the row, but I wanted to get the column. So basically, what I wanted to do is sort a matrix by a selected column when a said column header was clicked. So I was expecting to get (-1,column#) when the column header was clicked. I ended up just placing a bunch of buttons on top on the listbox aligned with the columns of the listbox. Not clean, but it works.
0 Kudos
Message 9 of 14
(8,721 Views)


@DBM wrote:
Yes, thanks for that idea. The silly reason I don't like the table is the shape of the pointer. It makes a user think that he should type something in the cell.

Anyway, thanks for the suggestion.




DBM
If this is just a matter of pointer shape, you can modify it at will. That's what I have done in the attached vi. The clever part was to send the cursor out of the display area.

CC
Chilly Charly    (aka CC)

         E-List Master - Kudos glutton - Press the yellow button on the left...
        
0 Kudos
Message 10 of 14
(8,702 Views)