Set LineModificationIndicators with AppendText?

SyntaxEditor for Windows Forms Forum

Posted 18 years ago by Karl Grambow
Avatar
Is it possible to manually set the LineModificationIndicators to show up when using Editor.Document.AppendText?

When creating a new Document I am, in some instances, pre-filling the Document with some text by using Editor.Document.Text = "some text". I could use AppendText I suppose.

I'd like to be able to make any text that I add programmatically have the LineModificationIndicators showing up but I can't figure out how to do it.

I've set,

Editor.Document.Modified = True and Editor.Document.LineModificationMarkingEnabled = True but it only seems to affect modifications that occur with Key Presses.

Thanks,

Karl

Comments (3)

Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Yes, each DocumentLine has a property for the color of the modification flag. You can set that appropriately but you probably need to call SyntaxEditor.Invalidate afterwards.


Actipro Software Support

Posted 18 years ago by Karl Grambow
Avatar
Thanks,

That worked.

Although I did find that changing the color of the modification flag doesn't actually change the LineModified property for that line (not sure if that's how it works). So I had to manually change all of the lines to color.green when I hit save. As such:

For Each line As DocumentLine In CurrentEditor.Document.Lines
     line.ModificationMarkColor = Color.Lime
Next
I assume that there isn't a big issue with how I've done it.

Karl
Posted 18 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Another quick way to change multiple lines from one color to another is by using Document.ChangeLineModificationMarkColor. I believe the default "no mark" color is Color.Empty.


Actipro Software Support

The latest build of this product (v24.1.0) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.