Export (0) Print
Expand All

ComboBox.SelectionStart Property

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

[Visual Basic]
Public Property SelectionStart As Integer
[C#]
public int SelectionStart {get; set;}
[C++]
public: __property int get_SelectionStart();
public: __property void set_SelectionStart(int);
[JScript]
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.

Exceptions

Exception Type Condition
ArgumentException The value is less than zero.

Remarks

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.

Requirements

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

Show:
© 2014 Microsoft