Table of Contents

Property SingleLineMode

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

SingleLineMode

Gets or sets a value indicating whether the control accepts only one line of the text.

public virtual bool SingleLineMode { get; set; }

Property Value

bool

Examples

Here is how to use a SingleLineMode 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.Text = "this is single line";
        textEditor.SingleLineMode = true;
    }
}

Here is how to use a SingleLineMode 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()
        textEditor.Text = "this is single line")
        textEditor.SingleLineMode = True
    End Sub
End Class

Remarks

Set SingleLineMode property to true to restrict TextEditor to display a single line of text. In this case, pressing the ENTER key will not create a new line of text.