Why does ReplaceText return false?

SyntaxEditor for Windows Forms Forum

Posted 7 years ago by Gil Milow
Version: 12.1.0302
Avatar

I am trying to do a ReplaceText in a SyntaxEditor control, and sometimes it returns false. Since it does not throw an exception there is no way for me to tell why it returns false.

What are the possible reasons for a return of false on this method?

thanks,

Gil

Comments (3)

Posted 7 years ago by Tobias Lingemann - Software Devolpment Engineer, Vector Informatik GmbH
Avatar

Looking at the implementation I would say the method returns false if the text region is (partly) read-only or the operation has been cancelled.


Best regards, Tobias Lingemann.

Posted 7 years ago by Gil Milow
Avatar

That was it, the region was readonly! It's strange that the ReplaceText has an option (DocumentModificationOptions.CheckReadOnly) for that (which I don't use), but I'm glad it works.

 

thanks!

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

Hi Gil,

The false result should only happen if either the modification occurs within a read-only range (and the CheckReadOnly flag on the modification is set), or if the Document.PreTextChanging event had a handler that said to cancel the modification.


Actipro Software Support

The latest build of this product (v2018.1 build 0342) was released 11 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.