Add text to the document

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by Martin Lundberg - Sweden
Avatar
Hello again!

This may be a stupid question, but how do I add text to where the caret is and then move the caret to the end of the added text.
And can I append text or do I have to do text = text + "my text"; or something like that?

Thanks again!

Martin Lundberg
Student, Sweden

Comments (2)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Use editor.SelectedView.InsertText or editor.SelectedView.InsertSurroundingText depending on what you want to do.

To append text, the best way is probably to do an editor.Document.UndoableInsert and put its offset at the end of the text. I'll add a TODO item to add an AppendText method or something similar which will be a wrapper for the UndoableInsert call.


Actipro Software Support

Posted 19 years ago by Martin Lundberg - Sweden
Avatar
Great, =) thanks!

Martin Lundberg
Student, Sweden

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.