X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/57c208c5759da71a637f0f0f5b7d3dc3eda09c02..26128999a7e2bc05024e09ba2658d4a6ab87accd:/src/msw/notebook.cpp diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index 07112916d4..34e0b589af 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -364,11 +364,13 @@ bool wxNotebook::InsertPage(int nPage, void wxNotebook::OnSize(wxSizeEvent& event) { - // emulate page change (it's esp. important to do it first time because - // otherwise our page would stay invisible) - int nSel = m_nSelection; - m_nSelection = -1; - SetSelection(nSel); + // make sure the current page is shown and has focus (it's useful because all + // pages are created invisible initially) + if ( m_nSelection != -1 ) { + wxNotebookPage *pPage = m_aPages[m_nSelection]; + pPage->Show(TRUE); + pPage->SetFocus(); + } // fit the notebook page to the tab control's display area RECT rc;