Table of Contents

Property IndentOptions

Namespace
Alternet.Editor.TextSource
Assembly
Alternet.Editor.v9.dll

IndentOptions

Gets or sets Alternet.Editor.TextSource.IndentOptions for this class, allowing to customize behavior of Edit control when user presses Enter to insert new text line.

public virtual IndentOptions IndentOptions { get; set; }

Property Value

IndentOptions

Examples

Here is how to use a IndentOptions in the C# code:

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.LoadFile("myfile.txt");

        textSource.IndentOptions = IndentOptions.AutoIndent | IndentOptions.SmartIndent | IndentOptions.JumpToIndent;
        syntaxEdit.Source = this.textSource;
    }
}

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

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.LoadFile("myfile.txt")
        textSource.IndentOptions = IndentOptions.AutoIndent Or IndentOptions.SmartIndent Or IndentOptions.JumpToIndent
        syntaxEdit.Source = Me.textSource
    End Sub
End Class

Remarks

Use IndentOptions to specify indentation behavior, such as the number of spaces or TAB characters to be inserted, when the user presses ENTER key in the SyntaxEdit control linked to this TextSource object.