Skip to content

Commit

Permalink
Issue #144: TMemo and friends select their text when pressing Enter, …
Browse files Browse the repository at this point in the history
…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 0fc09be
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/extra_controls.pas
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 0fc09be

Please sign in to comment.