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 changing appearance when pressed Collapse All
Subject Author Date
Seth Strong Jan 25, 2007 - 10:06 AM

What do I need to set so that I can change a button’s background when it is pressed? I use the SetBkColor which runs through its code fine but then it never visually changes.

Technical Support Jan 29, 2007 - 9:33 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. You can create a CExtButton-derived class and override the _RenderImpl() virtual method which draws the button. Just copy the contents of the original method and find:

_ppbd.m_clrForceBk = GetBkColor();
Here you can specify the background color depending on bEnabled, bHover and bPushed.