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:
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
Post a Comment