diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 4b7492acd8..0990d2af66 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -433,6 +433,13 @@ bool wxNotebook::InsertPage(int nPage, // this updates internal flag too - otherwise it will get out of sync pPage->Show(FALSE); + // fit the notebook page to the tab control's display area + RECT rc; + rc.left = rc.top = 0; + GetSize((int *)&rc.right, (int *)&rc.bottom); + TabCtrl_AdjustRect(m_hwnd, FALSE, &rc); + pPage->SetSize(rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top); + // some page should be selected: either this one or the first one if there is // still no selection int selNew = -1;