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 » CExtLabel (using icon not text) in CExtStatusControlBar - background not drawn correctly Collapse All
Subject Author Date
Alastair Watts Aug 9, 2010 - 4:19 AM

I’ve assigned an icon to a CExtLabel which is in a CExtStatusControlBar.  The background of the CExtLabel is drawn in a solid colour, rather than the gradient it should be.


 


 


 

Technical Support Aug 9, 2010 - 9:38 AM

The CExtLablel control supports themed background mode in two cases:

1) The text label.

2) Enhanced image mode. This is the text mode label with the bitmap assigned via the CExtLabel::SetBitmapEx() API.

All the other modes are themed for on-dialog labels only:

 void CExtLabel::OnPaint() 
{
            ASSERT_VALID( this );
DWORD dwWndStyle = GetStyle();
DWORD dwWndType = (dwWndStyle&SS_TYPEMASK);
            if(                     dwWndType == SS_BLACKRECT 
                        ||           dwWndType == SS_GRAYRECT 
                        ||           dwWndType == SS_WHITERECT 
                        ||           dwWndType == SS_BLACKFRAME 
                        ||           dwWndType == SS_GRAYFRAME 
                        ||           dwWndType == SS_WHITEFRAME 
                        ||           dwWndType == SS_USERITEM 
                        ||           dwWndType == SS_OWNERDRAW 
                        ||           dwWndType == SS_BITMAP 
                        ||           dwWndType == SS_ENHMETAFILE 
                        ||           dwWndType == SS_ETCHEDHORZ 
                        ||           dwWndType == SS_ETCHEDVERT 
                        ||           dwWndType == SS_ETCHEDFRAME 
                        )
            {
                        Default();
                        return;
            }
. . .
You can assign icons directly to status panes instead of creating controls inside the status bar:
CExtStatusControlBar & statusBar = . . .
INT nPaneIndex = . . .
HICON hIcon = . . .
CStatusBarCtrl & _ctrl = statusBar.GetStatusBarCtrl();
_ctrl.SendMessage( SB_SETICON, WPARAM(nPaneIndex), LPARAM(hIcon) );
Please let us know more details of your task so we can help you.