diff --git a/lcl/include/custommemo.inc b/lcl/include/custommemo.inc index 702917edef..8bc0af51c1 100644 --- a/lcl/include/custommemo.inc +++ b/lcl/include/custommemo.inc @@ -276,6 +276,13 @@ begin Result.CY := 90; end; +procedure TCustomMemo.UTF8KeyPress(var UTF8Key: TUTF8Char); +begin + inherited UTF8KeyPress(UTF8Key); + if not WantReturns and (UTF8Key = #13) then + UTF8Key := ''; +end; + procedure TCustomMemo.SetWantTabs(const NewWantTabs: boolean); begin if FWantTabs = NewWantTabs then exit; diff --git a/lcl/stdctrls.pp b/lcl/stdctrls.pp index fe98648a92..387760fd94 100644 --- a/lcl/stdctrls.pp +++ b/lcl/stdctrls.pp @@ -822,6 +822,7 @@ type procedure CMWantSpecialKey(var Message: TCMWantSpecialKey); message CM_WANTSPECIALKEY; procedure WMGetDlgCode(var Message: TLMNoParams); message LM_GETDLGCODE; class function GetControlClassDefaultSize: TSize; override; + procedure UTF8KeyPress(var UTF8Key: TUTF8Char); override; public constructor Create(AOwner: TComponent); override; destructor Destroy; override;