Pushbutton caption not displaying correctly in Dark Mode

I nearly have my app converted to a Free-Trial app but am hung-up on the simplest thing. The bottom-left pushbutton text displays correctly in Light Mode, but incorrectly in Dark Mode. I’ve tried everything I know and have scoured the forum for a solution. I’ve started from scratch a couple of times and remade the buttons several times, but nothing works. Both pushbuttons are garden variety controls, the bottom right button is set as the default button. “Supports Dark Mode” is enabled in Shared Build settings and I’m running Xojo 2019 3.1 on OS 10.15.3.
I know I can write custom canvas controls instead of using the pushbuttons, but I would really like to learn what I’m doing wrong here and why it isn’t working right.

Here are the buttons in Dark Mode.

And here they re in Light Mode.

Thanks for any help or suggestions.

A little progress on this, I think. If I set the window’s backdrop to none, the button caption is displayed correctly on both buttons. Is it the color of the backdrop image that’s causing the mix-up? Here’s a screenshot of the window if I set window.backdrop to “None”. BTW, the left button’s transparent setting is set to “False”.

macOS in Dark Mode uses translucent colors a lot. If you try to use light colored backgrounds, you’ll run in to this sort of issue all over the place. It’s best to not color the background in Dark Mode.

If you want to have an image background, make a Dark Mode compatible version of the image that is close to the expected background color of the window with no backdrop. You can then choose which image to display by checking IsDarkMode on Open.

Thanks, Anthony, for your reply. I think your advice about creating two backdrops is the answer. I’m still mystified, though, why it appears that, in Dark Mode, a control’s text color is based on its window color, but the control’s background color, like the push button in my case, isn’t. In my window, the pushbutton text gets the right color (white) in Dark Mode, but the pushbutton background gets the lighter color of the backdrop picture. Seems odd to me that both the control text and the control background colors aren’t derived from the same source, either the window color or the backdrop color. Just my 2 cents.
Thanks, again, for your help.
Be well.

The button background color is partially transparent, so when you’re using a light Window background the white text will blend in with the transparent color of the button (which is meant to be lighter than the default window background).

Thanks, Anthony, I see. How does it derive the control’s text color?

The system uses a static, fully opaque white for that with buttons.

Wow, I didn’t know control text color was that restrictive in Dark Mode. This is very helpful and I appreciate your responses. I have a much better understanding now of what Dark Mode is doing under the surface.
Many thanks.

Happy to help.