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 General Discussion » Way to override the background color and text color in CExtTabPageContainerWnd Collapse All
Subject Author Date
Cyndi Chatman Feb 1, 2007 - 11:54 AM

I am using this class and would like to make my tabs look like a flat blue bar (no borders around buttons) and change the text in the tabs to yellow. How can I do this?

Cyndi Chatman Feb 6, 2007 - 11:09 AM

Wouldn’t that mean I would have to rewrite all the code that is using page containers to just use tabs? I currently have dialog boxes and use pageinsert to add them to my tabpagecontainer. If CExtPageContainerWnd is derived from a CWnd, why can’t I just override OnCtlColor to do what I want? I have tried, but my OnCtlColor does not seem to be called.

Technical Support Feb 8, 2007 - 3:45 AM

A set of WM_CTLCOLOR*** standard windows messages and MFC’s OnCtrlColor() can meet all requirements when using common controls. In the case of Prof-UIS, the background is often more complex than that drawn with one GDI HBRUSH object.

You can also use inherited background painting notifications provided by Prof-UIS and demonstrated in the TabbedBars sample where you can turn on the option of painting a custom background (see the Options page in the main view window). Please let us know if the inherited background painting technique could meet your requirements.



Technical Support Feb 2, 2007 - 11:28 AM

You should create a CExtTabWnd-derived class which implements the CExtTabWnd::OnTabWndDrawItem() virtual method for custom tab item painting and the CExtTabWnd::OnTabWndEraseClientArea() virtual method for erasing tab control’s client area with the blue background. The One Note tabs (CExtTabOneNoteWnd), Whidbey tabs (CExtTabWhidbeyWnd) and flat tabs (CExtTabFlatWnd) can be used as a sample of custom tab control’s appearance implementation.