Why does ReplaceText return false?

SyntaxEditor for Windows Forms Forum

Posted 12 years ago by Gil Milow
Version: 12.1.0302

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?



Comments (3)

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

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 12 years ago by Gil Milow

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.



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

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

Add Comment

Please log in to a validated account to post comments.