Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » CExtButton Setting button colour Collapse All
Subject Author Date
Ian McIntosh May 16, 2007 - 7:27 AM

I have tried using:
SetBkColor(RGB(0,100,0));
but this has no effect on the button’s appearance.

I have stepped into _RenderImpl() and can confirm that within that function GetBkColor() returns 25600 - and not (-1).

Also:
SetTextColorHover(RGB(0,100,0));
seems to have no effect.

Ian McIntosh May 16, 2007 - 12:05 PM

So how do I set the button colour?

I assume this must be possible as it is set to orange when I hover over the button.

Technical Support May 17, 2007 - 12:11 PM

As we said above it is impossible to set the background color for a button when an Office 2007 theme is applied because these themes are based on bitmaps. As a workaround you could use, for example, the Office 2000 paint manager for your button. You can use a CExtPaintManagerCustomT template for that. You can find it here.

Technical Support May 16, 2007 - 11:59 AM

The SetBkColor() method works only for the Office 2000/XP/2003 and Visual Studio 2005 themes. Otherwise it is useless because the buttons are based on bitmaps.

As for the SetTextColorHover() we confirm that this is not working under some themes but we already fixed this bug (Most likely the new version will be released tomorrow).