Jump to content
Edwin Yip

TEdit with enhanced keyboard support?

Recommended Posts

Is there an enhanced TEdit (single-line edit, not multi-line editing such as TSynEdit) with enhanced keyboard support?

By enhanced keyboard support I mean for example, Ctrl+Backspace to delete a word, and so on.

Share this post


Link to post
52 minutes ago, dummzeuch said:

Isn't a single line edit part of synedit?

To be specific, which component?

Share this post


Link to post

Why don't you use the native Win32 TEdit but just enable CTRL+BACKSPACE?

 

Call  

 

    SHAutoComplete(WindowHandle, SHACF_AUTOAPPEND_FORCE_OFF or SHACF_AUTOSUGGEST_FORCE_OFF);

 

in an overridden CreateWnd. Use an interposer, or some other mechanism to get this code to run.

Edited by David Heffernan
  • Like 1

Share this post


Link to post
2 hours ago, David Heffernan said:

Why don't you use the native Win32 TEdit but just enable CTRL+BACKSPACE?

 

Call  

 

    SHAutoComplete(WindowHandle, SHACF_AUTOAPPEND_FORCE_OFF or SHACF_AUTOSUGGEST_FORCE_OFF);

 

in an overridden CreateWnd. Use an interposer, or some other mechanism to get this code to run.

Did a full text search of `SHAutoComplete` into my repositories and I couldn't believe I already have (but forgotten) a TEdit-derived control which already uses this trick, the code looks like:

[UIPermission(SecurityAction.LinkDemand, Window=UIPermissionWindow.AllWindows)]
procedure TEyEdit.CreateWnd;
begin
  inherited;

  //enable ctrl+backspace: http://stackoverflow.com/a/10305706/133516
  SHAutoComplete(Self.Handle, SHACF_AUTOAPPEND_FORCE_OFF or SHACF_AUTOSUGGEST_FORCE_OFF)
end;

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×