Table of Contents

Property SyntaxPaint

Namespace
Alternet.Editor
Assembly
Alternet.Editor.v9.dll

SyntaxPaint

Represents an object that implements IEditSyntaxPaint interface containing properties and methods used to draw editor content.

[TypeConverter(typeof(ExpandableObjectConverter))]
public virtual IEditSyntaxPaint SyntaxPaint { get; set; }

Property Value

IEditSyntaxPaint

Examples

Here is how to use a SyntaxPaint in the C# code:

public partial class Form1 : Form
{
    private void Form1_Load(object sender, EventArgs e)
    {
        var syntaxEdit1 = new Alternet.Editor.SyntaxEdit(this.components);
        syntaxEdit1.LoadFile("myfile.txt");
        syntaxEdit1.SyntaxPaint.ReadonlyBackColor = System.Drawing.Color.LightGray;
        syntaxEdit1.SyntaxPaint.ReadonlyForeColor = System.Drawing.Color.Brown;
    }
}

Here is how to use a SyntaxPaint in the Visual Basic code:

Partial Public Class Form1
    Inherits Form

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim syntaxEdit1 = New Alternet.Editor.SyntaxEdit(Me.components)
        syntaxEdit1.LoadFile("myfile.txt")
        syntaxEdit1.SyntaxPaint.ReadonlyBackColor = System.Drawing.Color.LightGray
        syntaxEdit1.SyntaxPaint.ReadonlyForeColor = System.Drawing.Color.Brown
    End Sub
End Class

Remarks

SyntaxPaint implements drawing of all SyntaxEdit text and graphic primitives.

By setting SyntaxPaint properties, you can control certain aspects SyntaxEdit control's drawing, such as specifying colors of read-only sections.