SWT- 如何在 Windows 中更改 ProgressBar 颜色? [英] SWT- How to change ProgressBar color in Windows?
本文介绍了SWT- 如何在 Windows 中更改 ProgressBar 颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有没有办法在 SWT 中更改 ProgressBar 条的颜色?.setForeground()
似乎不起作用.
Is there a way to change the color of a ProgressBar's bars in SWT? .setForeground()
doesn't seem to work.
如果无法以编程方式更改颜色,是否可以使用 WindowBuilder GUI 工具更改 ProgressBar 的颜色?
If there is not a way to change the color programmatically, is there a way to change ProgressBar's color using the WindowBuilder GUI tools?
谢谢!
推荐答案
在 SWT 中,有 3 种内置状态,每种状态用一种颜色表示:
In SWT there are 3 built-in states, each represented by a color:
progressBar.setState(SWT.ERROR); //Red Fill color. Useful when the task is aborted.
此状态不支持不确定的进度条样式(SWT.INDETERMINATE).
This state does not support an indeterminate progress bar style (SWT.INDETERMINATE).
progressBar.setState(SWT.PAUSED); //Yellow Fill color.
此状态将暂停不确定的进度条动画.
This state will pause the indeterminate progress bar animation.
progressBar.setState(SWT.NORMAL); //Default state and color as controlled by OS.
这篇关于SWT- 如何在 Windows 中更改 ProgressBar 颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文