+        if ( !s_isInOnSize )
+        {
+            s_isInOnSize = true;
+            SendMessage(GetHwnd(), WM_SIZE, SIZE_RESTORED,
+                    MAKELPARAM(rc.right, rc.bottom));
+            s_isInOnSize = false;
+        }
+    }
+
+    TabCtrl_AdjustRect(m_hwnd, false, &rc);
+
+    int width = rc.right - rc.left,
+        height = rc.bottom - rc.top;
+    size_t nCount = m_pages.Count();
+    for ( size_t nPage = 0; nPage < nCount; nPage++ ) {
+        wxNotebookPage *pPage = m_pages[nPage];
+        pPage->SetSize(rc.left, rc.top, width, height);
+    }
+
+
+    // unless we had already repainted everything, we now need to refresh
+    if ( !HasFlag(wxFULL_REPAINT_ON_RESIZE) )
+    {
+        // invalidate areas not covered by pages
+        RefreshRect(wxRect(0, 0, widthNbook, rc.top), false);
+        RefreshRect(wxRect(0, rc.top, rc.left, height), false);
+        RefreshRect(wxRect(0, rc.bottom, widthNbook, heightNbook - rc.bottom),
+                    false);
+        RefreshRect(wxRect(rc.right, rc.top, widthNbook - rc.bottom, height),
+                    false);
+    }
+
+    event.Skip();