LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Highlighting Other Columns in Multicolumn Listbox

Is there a property I'm not finding that allows the user to actually highlight the a different column.  So far, I can only highlight column uh... 0... Can't seem to highlight the number 10 (in picture) alone for example.  Click on 10 and 2 highlights.
When editing, you can still click on the desired row/column, pause, and then it changes to the edit "highlight" - but that's not quite the same.  This one of those... "then just use a string array" type things?  Except you can't highlight string arrays.  Or can you?  Surely there's a property I'm not seeing.

DailyDose_0-1680100582869.png

 

0 Kudos
Message 1 of 9
(1,279 Views)

Looks like you are talking about the selection color. The value of a listbox is a scalar per row. You can chose to highlight the entire row in the options.

 

Like in a table, you can have full programmatic control over the background color of each cell, here's one possibility:

 

altenbach_0-1680101382381.png

altenbach_0-1680101446936.png

 

 

 

Message 2 of 9
(1,275 Views)

No, I'm struggling to just simply highlight a different column. You'll notice in the next image, the first column is highlighted despite the 3rd column being edited.  I can't seem to highlight any other column but the first.  As I see you were able to do with yours.

 

DailyDose_0-1680102631941.png

 

0 Kudos
Message 3 of 9
(1,261 Views)

There is a big distinction between highlight color (indicating the current "value" of the listbox, i.e. the "row") and the background color, that can de different for any cell. In your case, the "value" of the listbox is "2". As I said, you can configure the listbox to "highlight entire row" if you like that better.

 

Personally, I sometimes make the selection color transparent and play with the background colors for full flexibility (e.g. using mouse down, value chage, or double-click events, etc.)

0 Kudos
Message 4 of 9
(1,248 Views)

So it sounds like additional code is actually required to make anything else "highlight" other than the first column.  Some innerworkings to determine which cell was selected and then change the background color of that cell to give the appearance of highlighted but then make sure you change it back.

0 Kudos
Message 5 of 9
(1,232 Views)

Yes

 


@DailyDose wrote:

So it sounds like additional code is actually required to make anything else "highlight" other than the first column.  


As I said, you can configure it to highlight the entire row instead. No code needed for that.

 

altenbach_0-1680107943116.png

 

It also looks like you are using the listbox items as user input by allowing editing. I would not do that.

 

Message 6 of 9
(1,222 Views)

Yeah, I was getting the sense I am probably not using this for its intended purposes.

 

But no, just wanted the individual cell.  Anyways, thank you.

0 Kudos
Message 7 of 9
(1,217 Views)

You seem to be using it to enter integers, which requires a lot of post-processing to validate the input because strings can be anything. There is no enforcement, such as with numeric controls.

 

If you really want the user to be able to enter values in a listbox, maybe something like this would be a better solution.

Message 8 of 9
(1,165 Views)

So the numerics were really just an example since it was just string.  What I am working on is a sort of Test Stand Sequencer type thing.  Which the first column would be the test name and subsequent columns in the row would be either pass/fail values and type of tests.  I was thinking that the users could then edit items on the fly if necessary (this is not production - engineers asking for changes to tests on a regular basis).  So to help, I was hoping that the cell they select to edit would highlight like it does in the first column as a visual queue of their selection.  Highlighting the row is still technically usable in this scenario.  I am thinking other options could be to come up with a cluster with test name, test type, pass/fail criteria, etc... and that gets populated with the listbox row selected.  And saying that out loud, is probably the way I'll go.

I do appreciate the link, I looked through that and that seems pretty useful.

0 Kudos
Message 9 of 9
(1,159 Views)