Table of Contents

Property Position

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

Position

Gets or sets the 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:

public partial class Form1 : Form
{
    private void Form1_Load(object sender, EventArgs e)
    {
        var syntaxEdit1 = new Alternet.Editor.SyntaxEdit(this.components);
        syntaxEdit1.LoadFile("myfile.txt");
        syntaxEdit1.Position = new System.Drawing.Point(0, syntaxEdit1.Lines.Count - 1);
        syntaxEdit1.MakeVisible(syntaxEdit1.Position);
    }
}

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

Partial Public Class Form1
    Inherits Form

    Private Sub Form1_Load(ByVal sender As Object, ByVal e As EventArgs)
        Dim syntaxEdit1 = New Alternet.Editor.SyntaxEdit(Me.components)
        syntaxEdit1.LoadFile("myfile.txt")
        syntaxEdit1.Position = New System.Drawing.Point(0, syntaxEdit1.Lines.Count - 1)
        syntaxEdit1.MakeVisible(syntaxEdit1.Position)
    End Sub
End Class

Remarks

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

Once the text content is loaded, the Position control resets its position to the beginning of the text.