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:

using System;
using System.Windows;
using Alternet.Editor.Wpf;

public partial class MainWindow : Window
{
    private TextSource textSource;
    private void Window_Loaded(object sender, RoutedEventArgs e)
    {
        var textEdit1 = new TextEditor();
        textSource = new TextSource();
        textSource.LoadFile("myfile.txt");
        textSource.Text = "this is single line";
        textSource.SingleLineMode = true;

        textEdit1.Source = this.textSource;
    }
}

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

Imports System
Imports System.Windows
Imports Alternet.Editor.Wpf

Partial Public Class MainWindow
    Inherits Window

    Private textSource As TextSource

    Private Sub Window_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim textEdit1 = New TextEditor()
        textSource = New TextSource()
        textSource.Text = "this is single line"
        textSource.SingleLineMode = True

        textEdit1.Source = Me.textSource
    End Sub
End Class

Remarks

Set SingleLineMode property to true to restrict TextSource to store a single line of text.

In this case, pressing the ENTER key in the linked TextEditor control will not insert a new text line.