This documentation is archived and is not being maintained.

TextBox.CaretIndex Property

Gets or sets the insertion position index of the caret.

Namespace: System.Windows.Controls
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public int CaretIndex { get; set; }
/** @property */
public int get_CaretIndex ()

/** @property */
public void set_CaretIndex (int value)

public function get CaretIndex () : int

public function set CaretIndex (value : int)

<object CaretIndex="int" .../>

Property Value

An integer indicating the zero-based insertion position index of the caret. An insertion position is between either characters or element tags. Getting this value returns the current insertion position index of the caret (see TextPointer for information on terminology like "insertion position"). Setting this value moves the caret to the specified insertion position. This property has no default value.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: