diff --git a/src/msw/notebook.cpp b/src/msw/notebook.cpp index aec8a9979a..d2fe79e557 100644 --- a/src/msw/notebook.cpp +++ b/src/msw/notebook.cpp @@ -329,6 +329,9 @@ bool wxNotebook::RemovePage(int nPage) m_aPages.Remove(nPage); + if ( m_aPages.IsEmpty() ) + m_nSelection = -1; + return TRUE; } @@ -344,6 +347,8 @@ bool wxNotebook::DeleteAllPages() TabCtrl_DeleteAllItems(m_hwnd); + m_nSelection = -1; + return TRUE; }