diff --git a/include/wx/msw/textctrl.h b/include/wx/msw/textctrl.h index 028032725d..ec1a9e0b4f 100644 --- a/include/wx/msw/textctrl.h +++ b/include/wx/msw/textctrl.h @@ -231,7 +231,8 @@ protected: // replace the contents of the selection or of the entire control with the // given text - void DoWriteText(const wxString& text, int flags = SetValue_SelectionOnly); + void DoWriteText(const wxString& text, + int flags = SetValue_SendEvent | SetValue_SelectionOnly); // set the selection possibly without scrolling the caret into view void DoSetSelection(long from, long to, bool scrollCaret = true); diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 53ec9740c7..4f69825027 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -802,7 +802,7 @@ void wxTextCtrl::DoSetValue(const wxString& value, int flags) // edit controls mostly) if ( (value.length() > 0x400) || (value != GetValue()) ) { - DoWriteText(value, flags); + DoWriteText(value, flags /* doesn't include SelectionOnly here */); // mark the control as being not dirty - we changed its text, not the // user @@ -1445,7 +1445,7 @@ void wxTextCtrl::Replace(long from, long to, const wxString& value) // Set selection and remove it DoSetSelection(from, to, false /* don't scroll caret into view */); - DoWriteText(value, SetValue_SelectionOnly); + DoWriteText(value); } void wxTextCtrl::Remove(long from, long to)