为 SWT Combo 设置颜色 [英] Set color for SWT Combo

查看:40
本文介绍了为 SWT Combo 设置颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将只读组合的颜色变成白色作为非只读组合

我的只读组合代码

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

我也尝试设置背景和前景,但不是这个东西.

解决方案

如果您认为值得付出努力,您仍然可以使用 CCombo 小部件作为模板来构建您自己的全白组合框.

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.

解决方案

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.

这篇关于为 SWT Combo 设置颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆