Changing textfield properties doesn't work

Using 2021 R1.1
Original color was yellow and it was set to read only.
Can anybody tell me why this doesn’t work?

txtPID.BackgroundColor = Color.White
txtPID.ReadOnly = False
txtPID.TabStop = true
txtPID.Refresh
txtPID.SetFocus

Thanks

On Windows it worked here. Your changes were been put in a button action and clicked here, no fail found.

Yep

The BackgroundColor change invalidates the rectangle, so the Refresh() is unnecessary.

Make no difference, Color doesn’t change and it’s still read only.

On Windows? If so, we need a small sample to see. Creating a new one as I said, it wasn’t reproducible.

No problems here with your code in macOS Mojave

I’ve seen bad behaviors like these on subclassed controls with bugs (events, painting, etc), but not with an instance of the original superclass.

I’m on Big Sur, maybe related!

Works as expected on macOS 11.3.

I’m on 11.4

Makes no sense

Can you reproduce in a simple demo?
I don’t have access to Big Sur but others can test to see if it fails with 11.4

I can do that.

I see things like that when Xojo has been running for a long time. A restart of the computer fixes it, alternatively quit Xojo and empty the cache by hand.

Did you see the same behavior?