Set color for SWT Combo

删除回忆录丶 提交于 2019-12-23 23:23:03

问题


I'm trying to turn color of my readonly combo to white as a non-readonly combo

My code for the readonly Combo

Combo myCombo = new Combo(sessionProperties, SWT.SINGLE | SWT.BORDER | SWT.READ_ONLY, "");

I also try to set background and foreground, but it not this thing.


回答1:


The background color is a hint. On some platforms, some controls cannot change their background color.

The SWT CCombo is a custom control that emulates the behavior of a combo box by using a text input field, a button, and a list.

Setting the background to white changes the text and list background color only. Not sure if that is what you were looking for.

If you think it's worth the effort you can still use the CCombo widget as a template to build your own all-white combo box.



来源:https://stackoverflow.com/questions/41340605/set-color-for-swt-combo

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!