positining cursor and highlighting section programmatically

SyntaxEditor for Windows Forms Forum

Posted 19 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 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Gavin,

Use the editor.SelectedView.Selection.SelectRange method.


Actipro Software Support

Posted 19 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 (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.