SelectionStart Property

TextBox.SelectionStart Property

 

Gets or sets a character index for the beginning of the current selection.

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

public int SelectionStart { get; set; }

Property Value

Type: System.Int32

The character index for the beginning of the current selection.

Exception Condition
ArgumentOutOfRangeException

SelectionStart is set to a negative value.

In cases where the specified selection length would cause the selection to end between a carriage return and a new-line character, the selection length is automatically increased by 1 so that the resulting selection spans the entire end-of-line marker.

.NET Framework
Available since 3.0
Silverlight
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft