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.
Version?
32/64bit?
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:
https://www.dropbox.com/scl/fi/d3916hxq2engkey2m4agv/ListboxSelectionIssue.xojo_binary_project?rlkey=dv4x7worg0aaeq9nmf98fp7nm&dl=0
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.
Confirmed.
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
KarenA
(KarenA)
September 2, 2023, 1:06pm
10
It has always been true on Windows.
-Karen
1 Like
AlbertoD
(AlbertoD)
September 2, 2023, 1:48pm
11
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
Tim_Hare
(Tim Hare)
September 3, 2023, 7:51am
13
Because it shouldn’t make any difference? A bug is a bug.
TimStreater
(TimStreater)
September 3, 2023, 11:22am
14
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
AlbertoD
(AlbertoD)
September 3, 2023, 1:38pm
16
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:
I’ve found that if I have my Listbox set to “Allow Expandable Rows”, then any empty row cannot be highlighted. I can still “technically” select them, as my Cut/Copy/Paste/Delete/Duplicate/Move code still works with them, you just cannot see that there are highlighted. Turn off “Allow Expandable Rows”, and everything works as before.
A bug? Or something special I have to do to highlight empty rows on a Listbox setup for Expandable Rows?