see the source of Button class, note it's method createHandle.void createHandle () { super.createHandle (); if ((style & SWT.PUSH) == 0) state |= THEME_BACKGROUND; if (OS.COMCTL32_MAJOR >= 6) { if ((style & SWT.RADIO) != 0) state |= DRAW_BACKGROUND; } }
但这里我又有点想法的是,像swt里都是重型组件,重型组件应该都是不透明的吧.
大哥大姐们,快来帮我解答疑惑啊.
super.createHandle ();
if ((style & SWT.PUSH) == 0) state |= THEME_BACKGROUND;
if (OS.COMCTL32_MAJOR >= 6) {
if ((style & SWT.RADIO) != 0) state |= DRAW_BACKGROUND;
}
}
真是谢谢你了.
那只好用gc.fillRect()来画出的背景吗?