tags:

views:

25

answers:

1

I'v created a text box and when it gets focus it sets the caret position to 0 rather than the end. I want to set it to the end. Thanks

|Text Here -> Text Here|

A: 

The caret position is basically the same as the current selection -- when the beginning and end are at different positions, you have some text selected. If the beginning and end of selection are at the same place, that's the caret position.

You can set the selection with EM_SETSEL. To put it at the end, use -1 for both the beginning and end of selection.

Jerry Coffin