This documentation is archived and is not being maintained.

ComboBox.SelectionStart Property

Gets or sets the starting index of text selected in the combo box.

[Visual Basic]
Public Property SelectionStart As Integer
public int SelectionStart {get; set;}
public: __property int get_SelectionStart();
public: __property void set_SelectionStart(int);
public function get SelectionStart() : int;
public function set SelectionStart(int);

Property Value

The zero-based index of the first character in the string of the current text selection.


Exception Type Condition
ArgumentException The value is less than zero.


If no text is selected in the control, this property indicates the insertion point for new text. If you set this property to a location beyond the length of the text in the control, the selection start position is placed after the last character. When text is selected in the text box control, changing this property can release the value of the SelectionLength property. If the remaining text in the control after the position indicated by the SelectionStart property is less than the value of the SelectionLength property, the value of the SelectionLength property is automatically decreased. The value of the SelectionStart property never causes an increase in the SelectionLength property.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ComboBox Class | ComboBox Members | System.Windows.Forms Namespace