diff --git a/src/msw/dialog.cpp b/src/msw/dialog.cpp index 1f57be36a8..dcb6304787 100644 --- a/src/msw/dialog.cpp +++ b/src/msw/dialog.cpp @@ -388,7 +388,7 @@ bool wxDialog::EmulateButtonClickIfPresent(int id) { wxButton *btn = wxDynamicCast(FindWindow(id), wxButton); - if ( !btn || !btn->IsEnabled() ) + if ( !btn || !btn->IsEnabled() || !btn->IsShown() ) return false; btn->MSWCommand(BN_CLICKED, 0 /* unused */);