Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » How to change button background color?
How to change button background color? [message #453822] Mon, 11 April 2005 13:41 Go to next message
Eclipse UserFriend
Originally posted by: mario.vanassche.scansoft.com

Hi,

Does anyone know how to change a button's background color? It seems that
the following statement has no effect:

button1.setBackground((button1.getDisplay().getSystemColor(S WT.COLOR_CYAN)));

If you apply the same thing to another control, e.g. a shell, it does work
fine:

shell.setBackground((shell.getDisplay().getSystemColor(SWT.C OLOR_CYAN)));

I found a lot of similar problems reported on other forums, but no real
solutions...

Thanks,

Mario Van Assche
Re: How to change button background color? [message #453831 is a reply to message #453822] Mon, 11 April 2005 16:50 Go to previous message
Eclipse UserFriend
Originally posted by: johns.atwork.comhem.se

Mario Van Assche wrote:
> Hi,
>
> Does anyone know how to change a button's background color? It seems
> that the following statement has no effect:
>
> button1.setBackground((button1.getDisplay().getSystemColor(S WT.COLOR_CYAN)));
>
>
> If you apply the same thing to another control, e.g. a shell, it does
> work fine:
>
> shell.setBackground((shell.getDisplay().getSystemColor(SWT.C OLOR_CYAN)));
>
> I found a lot of similar problems reported on other forums, but no real
> solutions...
>
> Thanks,
>
> Mario Van Assche
>

You can't do it on windows.

https://bugs.eclipse.org/bugs/show_bug.cgi?id=64957

John
Previous Topic:eclipse 3.1M6: unable to run a SWT app
Next Topic:How to capture image of a composite
Goto Forum:
  


Current Time: Thu Mar 28 17:26:35 GMT 2024

Powered by FUDForum. Page generated in 0.09906 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top