TextBox.SelectionLength Property

Definition

Gets or sets the number of characters in the current selection in the text box.

Equivalent WinUI property: Microsoft.UI.Xaml.Controls.TextBox.SelectionLength.

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

void SelectionLength(int value);
public int SelectionLength { get; set; }
var int32 = textBox.selectionLength;
textBox.selectionLength = int32;
Public Property SelectionLength As Integer
<TextBox SelectionLength="int"/>

Property Value

Int32

The number of characters in the current selection in the text box, or 0 if there is no selection.

Applies to