TextBox.CaretIndex Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets the insertion position index of the caret.

Namespace:   System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public int CaretIndex { get; set; }

Property Value

Type: System.Int32

The zero-based insertion position index of the caret.

Getting this property returns the current insertion position index of the caret (see TextPointer for information on terminology like "insertion position"). Setting this property moves the caret to the specified insertion position.

An insertion position is between either characters or element tags.

.NET Framework
Available since 3.0
Return to top
Show: