如何使组件在表单设计器中消失?
我正在创建一个包含其他控件的自定义控件,其中包括两个滚动条,一个水平滚动条,一个垂直滚动条。有一个属性可以将一个或两个滚动条设置为不可见,该属性在运行时工作正常,但在设计时,当我设置该属性时,它不会从表单设计器中消失。
现在,我可以理解,如果这是一个单独的控件,但它是聚合组件的一部分,因此它应该遵守父控件的规则,而不是表单设计者的规则,这如何成为一个有用的功能。有什么方法可以确保当我设置 .Visible := false;
时控件会消失,即使它位于表单设计器中?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以设置控件的“csNoDesignVisible”ControlStyle 标志。如果设置了该标志,Visible 属性将像运行时一样工作。
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.