problem with ReadOnlySpanIndicator

SyntaxEditor for Windows Forms Forum

Posted 16 years ago by Karl Grambow
Version: 4.0.0270
Avatar
Hi,

I'm using the ReadOnlySpanIndicator to create a readonly region, which works fine.

However, if I place the caret on the line immediately prior to the readonly region and I then press the Delete key, the readonly region comes up by one line (which I'd expect) and then stops being readonly.

I've pretty much mirrored the code that you provide in the sample project but I don't seem to have this problem on the sample project.

Is there some other property that I should be setting to prevent this from happening?

Here's the code that I'm using.

Dim layer As New SpanIndicatorLayer(SpanIndicatorLayer.ReadOnlyKey, SpanIndicatorLayer.ReadOnlyDisplayPriority)

editor.Document.SpanIndicatorLayers.Add(layer)

'some code goes here to find a start and end offset

layer.Add(New ReadOnlySpanIndicator, New TextRange(startOffset, endOffset))

Comments (2)

Posted 16 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
That code looks ok. Could you throw together a tiny sample project that shows it happening and email that over?


Actipro Software Support

Posted 16 years ago by Karl Grambow
Avatar
I tried that and everything worked fine. So went back to my code, figuring I must have something different.

Turns out there was some code in my DocumentTextChanged event that was removing some span indicators under certain conditions and it was catch the ReadOnlySpanIndicator.

Should have checked there first I guess.
The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.