Subclass cannot override property default in Inspector Behavior

Feedback Case Number:
I’ve created a subclass of the Webrectangle control. In the Inspector Behavior, I can set the Visible property to False. When I add the subclassed control to the WebPage, the Inspector shows the Visible property as True (ignoring my new default of False). When I run the app, the subclassed Webrectangle appears on the page. Wen I look at the XML of this subclass control, the Visible property is correctly shown as False. I’ve searched the Forum under a number of keywords but haven’t found a similar discussion. I’m new to Xojo so I wanted to run this past the Forum before I file a Feedback case. Your help and/or guidance is appreciated. Thanks

In your subclass, you didn’t happen to create the property again, did you? If so, you shouldn’t.

Greg -

No. I read that “shadowing” a property of the base class was a no-no. I’m just trying to change the default (of the base class) in my subclass. I’m successful in changing the default of several other properties of the same subclass. I’ve changed Height, Width, and Background Color. They work as expected. It’s only the “Visible” property I’m having a problem with. I’m able to work around it by setting Me.Visible = False in the Shown event and then re-raising the event.

Thanks for the quick reply

  • Brad

I can confirm that creating a WebRectangle subclass, changing the Visible to False using the Inspector Behavior, then dragging that subclass to a Webpage, the Visible is set to True:



Thanks AlbertoD.

Based on AlbertoD’s independent reproduction of the issue, I’ve filed Issue No. 73269.

1 Like