focus - How can I move the cursor to the end of the text (Delphi)? -


this code fill textbox using sendmessage function:

  c := 'hey there';   sendmessage(h1, wm_settext, 1, integer(pchar(c))); 

now, how can move cursor end of text?

if want messages take at:

  1. em_setsel
  2. em_exsetsel

also there have complete reference edit:

http://msdn.microsoft.com/en-us/library/ff485923%28v=vs.85%29.aspx

in code (no messages) this:

edit1.sellength := 0; edit1.selstart := 0;   // set caret before first character ... edit1.selstart := 1;   // set caret before second character ... edit1.selstart := length(edit1.text) // set caret after last character 

with messages:

sendmessage(h1, em_setsel, length(c), length(c)); 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -