Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Select Method (Int32, Int32)
Collapse the table of content
Expand the table of content

ToolStripTextBox.Select Method (Int32, Int32)

Selects a range of text in the text box.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public void Select(
	int start,
	int length


Type: System.Int32

The position of the first character in the current text selection within the text box.

Type: System.Int32

The number of characters to select.

If you want to set the start position to the first character in the control's text, set the start parameter to 0. You can use this method to select a substring of text, such as when searching through the text of the control and replacing information.


You can programmatically move the caret within the text box by setting the start parameter to the position within the text box where you want the caret to move to and set the length parameter to a value of zero (0). The text box must have focus in order for the caret to be moved.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft