Table of Contents

Property SingleLineMode

Namespace
Alternet.Editor.TextSource
Assembly
Alternet.Editor.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 Alternet.Editor;
using Alternet.Editor.TextSource;

public partial class Form1 : Form
{
    private TextSource textSource;
    private void Form1_Load(object sender, EventArgs e)
    {
        var syntaxEdit = new SyntaxEdit(this.components);
        textSource = new TextSource(this.components);
        textSource.Text = "this is single line";
        textSource.SingleLineMode = true;

        syntaxEdit.Source = this.textSource;
    }
}

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

Imports System

Imports Alternet.Editor
Imports Alternet.Editor.TextSource

Partial Public Class Form1
    Inherits Form

    Private textSource As TextSource

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim syntaxEdit = New SyntaxEdit(Me.components)
        textSource = New TextSource(Me.components)
        textSource.Text = "this is single line"
        textSource.SingleLineMode = True

        syntaxEdit.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 SyntaxEdit control will not insert a new text line.