Export (0) Print
Expand All

ComboBox.SelectionLength Property

Gets or sets the number of characters selected in the editable portion of the combo box.

[Visual Basic]
Public Property SelectionLength As Integer
[C#]
public int SelectionLength {get; set;}
[C++]
public: __property int get_SelectionLength();
public: __property void set_SelectionLength(int);
[JScript]
public function get SelectionLength() : int;
public function set SelectionLength(int);

Property Value

The number of characters selected in the combo box.

Exceptions

Exception Type Condition
ArgumentException The value was less than zero.

Remarks

You can use this property to determine whether any characters are currently selected in the combo box control before performing operations on the selected text. When the value of the SelectionLength property is set to a value that is larger than the number of characters within the text of the control, the value of the SelectionLength property is set to the entire length of text within the control minus the value of the SelectionStart property (if any value is specified for the SelectionStart 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