Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
37 Views

Set cursor position in a text box

I want to set the cursor position in a text box.

The default position appears to be at the start of the text, I want it at the end.

Thanks

0 Kudos
2 Replies
Highlighted
Black Belt
37 Views

You can use the EM_SETSEL message to set the cursor location.  To set it to the end of the text in the control supply the length of text in the edit control (perhaps obtained using the WM_GETTEXTLENGTH message) for both wParam and lParam.

0 Kudos
Highlighted
Beginner
37 Views

Thank you

0 Kudos