Accessing Caret in OnDocumentTextChanged Method

SyntaxEditor for Windows Forms Forum

Posted 7 years ago by Cody Thompson - Space Systems Engineer, a.i. solutions
Version: 12.1.0302
Avatar

Hello:

I am currently overriding the OnDocumentTextChanged method successfully and everything is working, but I find myself wanting to access the Caret for the current SyntaxEditor form. Many other method overrides like this provide the SyntaxEditor as an argument, which makes finding and handling the caret easy, but this one method does not. Is there any other way to access the Caret and/or change the Caret's offset from within this method override?

Thanks in advance.

Comments (4)

Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Cody,

Sorry but the language version of that event deals just with the document since technically the document may have none or even multiple SyntaxEditor instances editing it.  So it will never pass a SyntaxEditor instance. 

That being said, SyntaxEditor itself does raise a similar event so you could attach to its handler and in that case you know which SyntaxEditor raised it.


Actipro Software Support

Posted 7 years ago by Cody Thompson - Space Systems Engineer, a.i. solutions
Avatar

Hrm, that makes sense. What is the name of the similar event's method that I'd need to override in SyntaxEditor? I cannot seem to find it in the documentation at a cursor glance.

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

SyntaxEditor has a virtual OnDocumentTextChanged method and a DocumentTextChanged event too.


Actipro Software Support

Posted 7 years ago by Cody Thompson - Space Systems Engineer, a.i. solutions
Avatar

Oh, so it does. Excellent, that will do just fine. Thanks!

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.