positining cursor and highlighting section programmatically

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by GavinK151

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.....


Comments (2)

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

Use the editor.SelectedView.Selection.SelectRange method.

Actipro Software Support

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

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

The latest build of this product (v24.1.0) 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.