TextBox::SelectionStart 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 a character index for the beginning of the current selection.

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

public:
property int SelectionStart {
	int get();
	void set(int value);
}

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: