Skip to content
Permalink
Browse files

Issue #144: TMemo and friends select their text when pressing Enter, …

…when they were manipulated by SHAutoComplete, so fix that by leaving TCustomMemo as they are
  • Loading branch information...
ansgarbecker committed Sep 28, 2019
1 parent 1f22580 commit 0fc09be9e9a2204673781f1c5c68dacfe7224917
Showing with 2 additions and 1 deletion.
  1. +2 −1 source/extra_controls.pas
@@ -89,12 +89,13 @@ class procedure TExtForm.FixControls(ParentComp: TComponent);
TToolButton(Cmp).Style := tbsButton;
TToolButton(Cmp).Style := tbsDropDown;
end;
if Cmp is TCustomEdit then begin
if (Cmp is TCustomEdit) and (not (Cmp is TCustomMemo)) then begin
// Support Ctr+Backspace for deleting last word in TEdit and TButtonedEdit
// This did not work in OnCreate, so here's it in OnShow
// See https://stackoverflow.com/questions/10305634/ctrlbackspace-in-delphi-controls
// See issue #144
// Todo: find a way to fix TComboBox, for which this hack does nothing
// ... and for TMemo, which just selects all text when pressing Enter key
SHAutoComplete(TCustomEdit(Cmp).Handle, SHACF_AUTOAPPEND_FORCE_ON or SHACF_AUTOSUGGEST_FORCE_ON);
end;
end;

0 comments on commit 0fc09be

Please sign in to comment.
You can’t perform that action at this time.