diff --git a/src/msw/toolbar.cpp b/src/msw/toolbar.cpp index 5c4b2c4d5b..16bd76be16 100644 --- a/src/msw/toolbar.cpp +++ b/src/msw/toolbar.cpp @@ -1642,6 +1642,10 @@ void wxToolBar::OnEraseBackground(wxEraseEvent& event) bool wxToolBar::HandleSize(WXWPARAM WXUNUSED(wParam), WXLPARAM lParam) { + // wait until we have some tools + if ( !GetToolsCount() ) + return false; + // calculate our minor dimension ourselves - we're confusing the standard // logic (TB_AUTOSIZE) with our horizontal toolbars and other hacks const RECT r = wxGetTBItemRect(GetHwnd(), 0);