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 MainWindow : Window
    private void Window_Loaded(object sender, RoutedEventArgs e)
        var textEditor = new Alternet.Editor.Wpf.TextEditor();
        textEditor.Source.CheckSpelling = true;
        textEditor.AutoCorrection = true;
        textEditor.AutoCorrectDelimiters = (Alternet.Editor.EditConsts.Wpf.DefaultAutoCorrectDelimiters + "'").ToCharArray();
        textEditor.AutoCorrect += textEditor_AutoCorrect;

    private void textEditor_AutoCorrect(object sender, Alternet.Editor.Wpf.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 MainWindow

    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim textEditor = New Alternet.Editor.Wpf.TextEditor(Me.components)
        textEditor.Source.CheckSpelling = True
        textEditor.AutoCorrection = True
        textEditor.AutoCorrectDelimiters = (Alternet.Editor.Wpf.EditConsts.DefaultAutoCorrectDelimiters & "'").ToCharArray()
        AddHandler textEditor.AutoCorrect, New Alternet.Editor.Wpf.AutoCorrectEvent(AddressOf Me.textEditor_AutoCorrect)
    End Sub

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


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

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