Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

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:
© 2017 Microsoft