-#if wxUSE_UXTHEME && wxUSE_NOTEBOOK
- if ( wxUxThemeEngine::GetIfActive() )
- {
- for ( wxWindow *win = this; win; win = win->GetParent() )
- {
- if ( win->IsTopLevel() )
- {
- // don't go beyond the first top level parent
- break;
- }
-
- wxNotebook *nbook = wxDynamicCast(win, wxNotebook);
- if ( nbook )
- {
- // return value may be NULL but it is ok: if the first parent
- // notebook doesn't use themes, then we don't have to process
- // this message at all, so let default processing take place
- return nbook->GetThemeBackgroundBrush(pDC, this);
- }
- }
- }
-#endif // wxUSE_UXTHEME
+ if ( HasTransparentBackground() )
+ ::SetBkMode((HDC)pDC, TRANSPARENT);
+ else // if the control is opaque it shouldn't use the parents background
+ colBg = GetBackgroundColour();