如何添加滚动条到TComponent?(How to add scrollbars to a TComponent?)

编程入门 行业动态 更新时间:2024-10-26 07:40:08
如何添加滚动条到TComponent?(How to add scrollbars to a TComponent?)

我使用的是来自TComponent后裔的第三方控件,我希望它具有滚动条,最好是自动滚动条。

我可以从TComponent中获得它们吗?

如果不这样做,我可以在我的mainform和组件上放置一个TPanel并获取滚动条? 我打算让组件(和面板,或其他)是alClient,以便它们在我的组件调整大小时自动调整大小,但我也想让它们具有(自动)滚动条。

I am using a 3rd party control which is descended from TComponent and I want it to have scrollbars, preferably autoscrollbars.

Can I get them from TComponent?

Failing that, can I place a TPanel on my mainform & the component on that and get scrollbars? I intend to have the component (and Panel, or whatever) be alClient so that they autoresize when my component resizes, but I woudl also like them to have (auto) scrollbars.

最满意答案

如果我明白你打算做什么,请这样做:

在窗体上添加一个TScrollBox 在TScrollBox组件上添加可视化组件 不要担心滚动条,因为它们会在需要时自动显示(当组件不在可见区域时) 玩的开心!

If I understood what you're intended to do, do this:

add a TScrollBox on the form add visual components on the TScrollBox component don't worry about scroll bars, because they will be shown automatically when needed(when a component is out of the visible area) have fun!

更多推荐

本文发布于:2023-08-07 22:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1466025.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:滚动条   TComponent   scrollbars   add

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!