SelectedText Property

ComboBox.SelectedText Property

Gets or sets the text that is selected in the editable portion of a ComboBox.

[Visual Basic]
Public Property SelectedText As String
public string SelectedText {get; set;}
public: __property String* get_SelectedText();
public: __property void set_SelectedText(String*);
public function get SelectedText() : String;
public function set SelectedText(String);

Property Value

A string that represents the currently selected text in the combo box. If DropDownStyle is set to ComboBoxStyle.DropDownList, the return is an empty string ("").


You can assign text to this property to change the text currently selected in the combo box. If no text is currently selected in the combo box, this property returns a zero-length string.


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

© 2015 Microsoft