# wxStyledTextCtrl: how to set caret at begining of a selection?

**URL:** <https://www.ruby-forum.com/t/wxstyledtextctrl-how-to-set-caret-at-begining-of-a-selection/204572>\
**Category:** wxRuby\
**Created:** [March 16, 2011, 12:06am UTC](https://www.ruby-forum.com/t/wxstyledtextctrl-how-to-set-caret-at-begining-of-a-selection/204572 "2011-03-16T00:06:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [March 16, 2011, 12:06am UTC](https://www.ruby-forum.com/t/wxstyledtextctrl-how-to-set-caret-at-begining-of-a-selection/204572/1 "2011-03-16T00:06:17Z")

</div>

Hi there,

I was trying to select text backwards in a StyledTextCtrl, i.e, want the  
caret to be in the front, not at the end of selection, however  
unsucessful.

My code like this:  
set\_selection\_end(11)  
set\_selection\_start(5)

Any suggestions? thanks in advance.

Zhimin
