diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 91ca4d8ce4..79040fcb2c 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1963,13 +1963,17 @@ wxSize wxTextCtrl::DoGetBestSize() const int wText = DEFAULT_ITEM_WIDTH; - int hText = EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy); + int hText = cy; if ( m_windowStyle & wxTE_MULTILINE ) { hText *= wxMax(GetNumberOfLines(), 5); } //else: for single line control everything is ok + // we have to add the adjustments for the control height only once, not + // once per line, so do it after multiplication above + hText += EDIT_HEIGHT_FROM_CHAR_HEIGHT(cy) - cy; + return wxSize(wText, hText); }