是否可以使用绘图侦听器更改进度条颜色?
我不想要一个初始的前景和背景颜色,而是希望它像正常的绿色进度条在 Windows 上的工作方式一样工作,但具有我自己的前景和背景。
我尝试了下面的代码,但它不起作用
GC gc = event.gc;
Device device=Display.getDefault();
Color foreground = gc.getForeground();
Color background = gc.getBackground();
gc.setForeground(device.getSystemColor(SWT.COLOR_RED));
gc.setBackground(device.getSystemColor(SWT.COLOR_YELLOW));
我坚持这个要求,并被告知可以使用绘画监听器,想知道如何!
任何帮助,将不胜感激。