Table of Contents

Property AutoCorrectDelimiters



Gets or sets an array of chars that used as word delimiters.

public virtual char[] AutoCorrectDelimiters { get; set; }

Property Value



Here is how to use a AutoCorrectDelimiters 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.Source.CheckSpelling = true;
        syntaxEdit1.AutoCorrection = true;
        syntaxEdit1.AutoCorrectDelimiters = (Alternet.Editor.EditConsts.DefaultAutoCorrectDelimiters + "'").ToCharArray();
        syntaxEdit1.AutoCorrect += SyntaxEdit1_AutoCorrect;

    private void SyntaxEdit1_AutoCorrect(object sender, Alternet.Editor.AutoCorrectEventArgs e)
        switch (e.Word)
            case "String":
                e.CorrectWord = "string";
                e.HasCorrection = true;

Here is how to use a AutoCorrectDelimiters 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.Source.CheckSpelling = True
        syntaxEdit1.AutoCorrection = True
        syntaxEdit1.AutoCorrectDelimiters = (Alternet.Editor.EditConsts.DefaultAutoCorrectDelimiters & "'").ToCharArray()
        AddHandler syntaxEdit1.AutoCorrect, New Alternet.Editor.AutoCorrectEvent(AddressOf Me.SyntaxEdit1_AutoCorrect)
    End Sub

    Private Sub SyntaxEdit1_AutoCorrect(ByVal sender As Object, ByVal e As Alternet.Editor.AutoCorrectEventArgs)
        Select Case e.Word
            Case "String"
                e.CorrectWord = "string"
                e.HasCorrection = True
        End Select
    End Sub
End Class


The SyntaxEdit control can be configured to automatically correct misspelled words as the user types by setting AutoCorrection property and handling the AutoCorrect event to provide correct word spelling.

This event is triggered when the user types one of the characters defined by AutoCorrectDelimiters.