03-29-2023 09:37 AM
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.
03-29-2023 09:50 AM - edited 03-29-2023 09:50 AM
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:
03-29-2023 10:10 AM - edited 03-29-2023 10:11 AM
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.
03-29-2023 10:36 AM
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.)
03-29-2023 11:09 AM - edited 03-29-2023 11:10 AM
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.
03-29-2023 11:41 AM
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.
It also looks like you are using the listbox items as user input by allowing editing. I would not do that.
03-29-2023 11:49 AM - edited 03-29-2023 11:49 AM
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.
03-30-2023 09:38 AM
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.
03-30-2023 10:33 AM
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.