howto implement readonly separator lines

SyntaxEditor for Windows Forms Forum

Posted 11 years ago by Walter Leinert - Hewlett Packard GmbH
Avatar
Productversion: Syntaxeditor 4.0.275.0 on Windows XP, SP3

Hi,
i'm implementing some kind of special text editor which works on a text which is divided in several (independent) sections. A section may be collapsed.
Each section should be separated by the next one by e.g. 1 readonly separator line, which may not be edited at all. So i'm adding a ReadOnlySpanIndicator between sections. But how do i suppress changes at the beginning of my separator line so the the whole line remains an unchanged readonly line?

E.g. i want to suppress the Back key to NOT move a separator line behind the end of the previous line or to suppress the Delete key at the end of a preceeding text line.

I experimented with Document.OnTextChanging and tried to set e.Cancelled to true which did not work; not i have some working solution by handling keys in SyntexEditor.OnKeyDown, but this does not suppress text insertion at the beginning of my separator line.

I'm searching for a better or correct solution or workaround for my issue.

Regards, Walter

Comments (1)

Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Walter,

The TextChanging event fires once a text change has been committed and will occur for sure. The PreTextChanging event fires before TextChanging and allows you to cancel the modification. So it sounds like that is what you would want to use instead.


Actipro Software Support

The latest build of this product (v2020.1 build 0400) was released 24 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.