Custom PushButton setting ButtonStyle reports "This item does not exist"

I have a PushButton Subclass that I set specific properties in the Open event:

#if Not TargetMacOS If Me.Height < 26 Then Me.Height = 26 Me.TextSize = 12 Me.ButtonStyle = PushButton.ButtonStyle.Square Me.Refresh(True) #endif
For some reason this afternoon, the compiler is reporting an error on the Me.ButtonStyle = PushButton.ButtonStyle.Square line where it never has before. I’ve used this subclass since the PushButton Styles were introduced and I’ve been running this code on another system for the past 3 days with no issues. Of course, this is happening when compiling for Windows or Linux.

I suspect that there is something else that has created an issue upstream, but since the error is occurring in the class definition, I’m lost as to how to troubleshoot things.

2019r1 - Any ideas?

You cannot set the property in code. Says here:

Besides, it is a macOS only feature…

Thanks Michel, but the question them becomes “why has this not popped up in the years that this code has existed?”.

Strange Days …

“This page was last edited on 1 June 2017, at 19:28.” so you’ve been doing it wrong for at least two years :wink:
(I know it’s not the answer you’re looking for, though sometimes extra info from the docs is enlightening)

Yep - just odd that the error has never popped up previously.

You may want to switch to BevelButton. It is more Xplat, and the Bevel property seems to be modified in code.

Actually, I’m going to a custom control based on a Canvas so that I have 100% control over the drawing and functionality. I’ve been using JavaFX for a few other projects and have grown to like the control that CSS provides for control layout and appearance.