positining cursor and highlighting section programmatically

SyntaxEditor for Windows Forms Forum

Posted 14 years ago by GavinK151
Avatar
hi,

I need to position the cursor and highlight a section of text programatically but cant seem to figure it out.
I used to use a plain old textbox for this using:

blah.Selection.SelLength = 590;
blah.Selection.SelEnd = 890;

How can I do the same thing with the SyntaxEditor? Its probably obvious so sorry for dumb questions :-)

I know about Caret.Offset but it seems to have no visual result though querying the position after using Caret.Offset does show it has moved.....

thanks!

Comments (2)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Gavin,

Use the editor.SelectedView.Selection.SelectRange method.


Actipro Software Support

Posted 14 years ago by GavinK151
Avatar
thanks!!! that worked perfectly, just what I needed.

Again, thank you for your fast response (do you guys never sleep?) :-)

cheers,
Gav
The latest build of this product (v2018.1 build 0341) was released 3 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.