简体   繁体   English

设置滚动条的背景色

[英]Set background color for scrollbar

I use ScrolledComposite and I can't find how to change background of ScrollBars. 我使用ScrolledComposite ,但找不到如何更改ScrollBars的背景。 Is it possible to change background of ScrollBars? 是否可以更改ScrollBars的背景?

No, setting the background color of scroll bars is not possible in SWT. 不可以,在SWT中无法设置滚动条的背景颜色。

SWT is designed to use the native GUI library of the respective platform and it is this library that defines the look and feel of the widgets, including the colors of scroll bars. SWT设计为使用相应平台的本机GUI库,而该库定义了小部件的外观和感觉,包括滚动条的颜色。

Short answer: No. 简短答案:不可以。

Long answer: No, because SWT is built on top of OS native UI. 长答案:不,因为SWT是建立在OS本机UI之上的。 You can't change the native looks and feels. 您无法更改本机的外观。

Although...: You can "hack" it by painting on top of the scrollbar control. 虽然...:您可以通过在滚动条控件上绘画来“破解”它。 In my opinion, that's a lot of hussle, and it's not worth it. 在我看来,这很麻烦,这是不值得的。

Other solutions: Use JavaFX. 其他解决方案:使用JavaFX。 Almost fully customizable. 几乎完全可定制。

Similar questions: Here , here , also here 类似的问题: 这里 在这里

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM