List box, ReadOnly: Sometimes appears disabled, sometimes appears enabled

LO 24.8.4.2, Windows 10 22H2

I’ve got a form with 2 list boxes. Under some circumstances, the code makes the selection in the list boxes and sets them to ReadOnly so the user can’t change them. Unfortunately, the boxes appear disabled. Instead of black letters, they have grey letters, which is harder to read. If I manually trigger test code that sets ReadOnly = False and then moves the focus to the boxes and away, and then manually trigger test code that resets ReadOnly = True, then the list boxes appear as they should. The letters are black and easily legible, but the user can’t change the selection.

Unfortunately, this doesn’t work if I have the code do this all at once. The list boxes appear disabled, with grey letters.

I am aware of p.224 in the LO Base Guide that says that users can change the selection in ReadOnly list boxes, but that doesn’t seem to be true any longer. ReadOnly list boxes seem to be truly ReadOnly now.

Does anybody know of a way to get ReadOnly list boxes to consistently display the easy-to-read black lettering, instead of switching between black and grey lettering?

It’s 160869 – Forms: Listboxes, set as "readonly", will be greyed out. Other controls, set "readonly", won't.

OK, so there’s no solution. The frustrating thing is that I can get it to display properly by manually giving it the focus, but doing that with code has no effect.

Sometimes I want to give up computers and go back to scratching ones and zeros on the cave wall with mastodon bones.