Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I make a component disappear in the form designer?

I'm creating a custom control that contains other controls, including two scroll bars, one horizontal, one vertical. There's a property to set one or both scroll bars invisible, which works fine at runtime, but at design-time it doesn't disappear from the form designer when I set the property.

Now, I can understand how this could be a useful feature if this was an individual control, but it's part of an aggregate component and so it ought to obey the parent control's rules, not the form designer's. Is there any way to make sure the control will disappear when I set .Visible := false; even when it's in the form designer?

like image 232
Mason Wheeler Avatar asked Dec 14 '22 02:12

Mason Wheeler


1 Answers

You can set the "csNoDesignVisible" ControlStyle flag of the control. If that flag is set the Visible property will work as it does at runtime.

like image 171
Andreas Hausladen Avatar answered Mar 24 '23 05:03

Andreas Hausladen