如何让TForm在BorderStyle=bsNone时显示滚动条?
当其 BorderStyle 设置为 bsNone 时,即使 AutoScroll 为 True 并且某些子控件位置超过 ClientWidth/ClientHeight 值,TForms 通常也不会显示滚动条。
那么,是否有任何方法/黑客可以“强制”TForm 显示滚动条(需要时),即使其 BorderStyle 设置为 bsNone ?
When their BorderStyle is set to bsNone, TForms usually won't show scrollbars even if the AutoScroll is True and some children controls positions exceed ClientWidth/ClientHeight values.
So, is there any method/hack to "force" TForm to show scrollbars (when needed) even if its BorderStyle is set to bsNone?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在窗体上放置一个
TScrollBox
,使其Align=Client,将所有控件放在滚动框上。我总是使用
TScrollBox
因为它非常灵活。您可以将顶部对齐的面板添加到表单(滚动框之外),并且您将获得一个非滚动区域。拥有整个表单滚动并不总是有帮助,而且几乎永远不会看起来很好。Put a
TScrollBox
on the form, make it Align=Client, put all your controls on the scroll box.I always use a
TScrollBox
because it's very flexible. You can add a top-aligned panel to the form (outside the scroll-box) and you've got a non-scrolled area. Having the whole form scroll is not always helpful and it almost never looks good.