Huy Hóm Hỉnh
Huy Hóm Hỉnh

Reputation: 617

Set color for SWT Combo

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

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. enter image description here

Upvotes: 3

Views: 1801

Answers (1)

Rüdiger Herrmann
Rüdiger Herrmann

Reputation: 21025

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.

enter image description here

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.

Upvotes: 5

Related Questions