Listbox selection only highlighting first column of selected rows

This only occurs on Windows but looks fine on Mac.

When I select rows from my listbox, only the first column gets highlighted:

I do not have any CellBackgroundPaint code or anything fancy going on, just a regular DesktopListbox.

Here’s the same project running on Mac that is exhibiting the desired behavior:

Any ideas on what might be going on here and how to fix it?

No idea.

Create a simple project you can share that display this behavior and share it, so maybe we will be able to give an answer.

Just tested it here and it selects the whole row for me…

How about you list all the event handlers for this listbox, and post the code that is in each of them (remembering to use the </> button).

You sure you’re not just clicking in a writeable cell and selecting the text there?

1 Like

Here is a sample project that illustrates the issue:

None of the fields are editable but clicking on any row in any column only highlights the first column of the row.

Oh, forgot to mention, Windows 10.0.19042.906, 64-bit.

That’s a good little demo, and indeed here in a Windows 10 VM if behaves as you describe. If no one here has an answer then you should open an Issue with that as the example project. With Listboxes I mostly do my own highlighting of rows or cells.

For the record, 32 bit didn’t make a difference.
Changing the classes back to ListBox and Window and Application didnt make a difference.

Same project in Xojo 2021 works properly in 64bit

This is an effect of the Expandable Rows property on Windows. Confused by Jeff’s success, I tested and confirmed that this is true as far back as 2019r1.1 (I no longer use anything older).


You can see this effect for yourself in Lifeboat with the Server Tools section.

1 Like

It has always been true on Windows.


1 Like

If you are not going to use Expandable Rows, then change this setting:

If you are, then you need to add the Painting you need for Windows.

1 Like

Because it shouldn’t make any difference? A bug is a bug.

So, you going to file an Issue?

It’s not technically a bug, it’s how Xojo’s Windows Listbox draws with expandable rows. When the Listbox was designed, that’s how Windows would draw lists like this. You can see the difference in Windows 11 between older dialogs like File Explorer Options and the new Task Manager.

1 Like

As Tim said, it was designed that way to match how Windows worked.

I guess the new grid control (when released and if it allows expandable rows) should work as a new Windows control?

You didn’t say it was a bug in this topic: