diff --git a/src/msw/control.cpp b/src/msw/control.cpp index 8a8bbee16d..3ab9e10eea 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -359,6 +359,12 @@ WXHBRUSH wxControl::MSWControlColor(WXHDC pDC) { 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 ) {