From 59d26b0badfd95c54a43463a1ecae8b9e7f3bf98 Mon Sep 17 00:00:00 2001 From: Steve Browne Date: Mon, 19 Dec 2016 10:56:55 -0500 Subject: [PATCH] Keep disabled status when wxBitmapComboBox is recreated in wxMSW If a disabled wxBitmapComboBox had to be recreated, it lost its disabled status and became unexpectedly enabled. Fix this by explicitly disabling it back in RecreateControl() if necessary. Closes https://github.com/wxWidgets/wxWidgets/pull/376 --- src/msw/bmpcbox.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/msw/bmpcbox.cpp b/src/msw/bmpcbox.cpp index 0b33efd5d2..6f1b9bd0e1 100644 --- a/src/msw/bmpcbox.cpp +++ b/src/msw/bmpcbox.cpp @@ -212,6 +212,10 @@ void wxBitmapComboBox::RecreateControl() // Revert the old string value if ( !HasFlag(wxCB_READONLY) ) ChangeValue(value); + + // If disabled we'll have to disable it again after re-creating + if ( !IsEnabled() ) + DoEnable(false); } wxBitmapComboBox::~wxBitmapComboBox()