Skip to content

Commit 2e193b9

Browse files
authored
Update ComboBox.xml (#4529)
Add a remark that reading `ComboBox.Text` is dependent on whether there is a selected item or not.
1 parent 5d031bc commit 2e193b9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

xml/System.Windows.Forms/ComboBox.xml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3919,7 +3919,9 @@
39193919
<format type="text/markdown"><![CDATA[
39203920
39213921
## Remarks
3922-
Setting the <xref:System.Windows.Forms.ComboBox.Text%2A> property to `null` or an empty string ("") sets the <xref:System.Windows.Forms.ComboBox.SelectedIndex%2A> to -1. Setting the <xref:System.Windows.Forms.ComboBox.Text%2A> property to a value that is in the <xref:System.Windows.Forms.ComboBox.Items%2A> collection sets the <xref:System.Windows.Forms.ComboBox.SelectedIndex%2A> to the index of that item. Setting the <xref:System.Windows.Forms.ComboBox.Text%2A> property to a value that is not in the collection leaves the <xref:System.Windows.Forms.ComboBox.SelectedIndex%2A> unchanged.
3922+
Setting the <xref:System.Windows.Forms.ComboBox.Text%2A> property to `null` or an empty string ("") sets the <xref:System.Windows.Forms.ComboBox.SelectedIndex%2A> to -1. Setting the <xref:System.Windows.Forms.ComboBox.Text%2A> property to a value that is in the <xref:System.Windows.Forms.ComboBox.Items%2A> collection sets the <xref:System.Windows.Forms.ComboBox.SelectedIndex%2A> to the index of that item. Setting the <xref:System.Windows.Forms.ComboBox.Text%2A> property to a value that is not in the collection leaves the <xref:System.Windows.Forms.ComboBox.SelectedIndex%2A> unchanged.
3923+
3924+
Reading the <xref:System.Windows.Forms.ComboBox.Text%2A> property returns the text of <xref:System.Windows.Forms.ComboBox.SelectedItem%2A>, if it is not `null`.
39233925
39243926
39253927

0 commit comments

Comments
 (0)