How do I get the API after setting a text box to goto the last word in the text box?
I'm having a problem with figuring this out so, how would I goto the last word in a textbox after setting the text box text? For example I put the text "lala" into a textbox and it'll put the cursor to the beginning of the text how would I get the cursor to goto the end instead of the beginning?
Re: How do I get the API after setting a text box to goto the last word in the text box?
Hai,
if its your own vb app then,
Code:
Me.Text1.SelStart = Len(Me.Text1.Text)
Me.Text1.SelLength = 1
Re: How do I get the API after setting a text box to goto the last word in the text box?
I'm coding API for someone elses application and want to know how to get the cursor to the end of there textbox after it places text in it
Re: How do I get the API after setting a text box to goto the last word in the text box?
oh is it,
hm, ill check it. did you check with spy++ for what messages are send when do such a thing. ok ill come back if i got a solution :)
May be there should be a simple way :)
Re: How do I get the API after setting a text box to goto the last word in the text box?
OK,
Code:
SendMessage(hwnd,WM_KEYDOWN,VK_END,0)
Should be working fine :)
Re: How do I get the API after setting a text box to goto the last word in the text box?
Don't forget to put in
before the code
Re: How do I get the API after setting a text box to goto the last word in the text box?
Or you could use the EM_SETSEL message.
http://support.microsoft.com/kb/109550