Table of Contents

Property Position

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

Position

Gets or sets current position within the control's text content.

[Browsable(false)]
public virtual Point Position { get; set; }

Property Value

Point

Examples

Here is how to use a Position 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.Position = new System.Drawing.Point(0, textSource.Lines.Count - 1);

        syntaxEdit.Source = this.textSource;
    }
}

Here is how to use a Position 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.Position = New System.Drawing.Point(0, textSource.Lines.Count - 1)

        syntaxEdit.Source = Me.textSource
    End Sub
End Class

Remarks

Position specifies the insertion point in the column and row coordinates within the text.