Re: Background color on a tab page with XP theme
On Wed, 25 Jun 2008 14:07:19 -0600, "Timothy Dean" <my_email@this.com>
wrote:
Yeah, I meant to say OnInitDialog. I have attached a minimal sample.
Thanks for your help.
If I apply the method I presented earlier in my
SubDialogTabCtrl::CreatePageWindow function for resizing the subdialog to
fill the tab control, I get a gradient consistent with property sheet
implementations such as used by control panel applets. (I verified this by
lining up Display Properties with your dialog and checking pixel colors
with Pixeur in WinXP.) I made the following change inside your
CXPThemeDialogDlg::OnInitDialog() function:
#if 1
// My changes.
m_tabControl.AdjustRect(false, rect);
m_propertyPage1.MoveWindow(rect);
#else
// Original code.
m_tabControl.ClientToScreen(&rect);
m_propertyPage1.SetWindowPos(NULL, rect.left, rect.top, 0, 0,
SWP_NOSIZE | SWP_NOZORDER);
#endif
I believe your confusion is due to things:
1. You weren't filling the entire tab control with your subdialog.
2. Although it starts out the same color, the gradient for the subdialog is
not as "quick" as that for the tab control itself, and it looks quite white
in comparison to the tab control background. You can check this out with a
free tool such as Pixeur.
BTW, you really, really need a tool like Pixeur, because you can't trust
your eyes! For example see:
The Checkershadow Illusion
http://web.mit.edu/persci/people/adelson/checkershadow_illusion.html
Neat, isn't it!
--
Doug Harrison
Visual C++ MVP