Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/mcs
diff options
context:
space:
mode:
authorPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>2006-02-28 22:23:42 +0300
committerPeter Dennis Bartok <pbartok@mono-cvs.ximian.com>2006-02-28 22:23:42 +0300
commitc11dad3d2fcab65203b5a96f7c58f15cc25e49a4 (patch)
tree44d6b0744d37619c436dcb1dab35275a6c3f1eec /mcs
parent181d10350c45a24acf0e79dabdaeb3acd03fc1aa (diff)
2006-02-28 Peter Dennis Bartok <pbartok@novell.com>
* ComboBox.cs: Allow setting SelectedIndex to -1. Fixes #77665 svn path=/trunk/mcs/; revision=57416
Diffstat (limited to 'mcs')
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog4
-rw-r--r--mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs6
2 files changed, 9 insertions, 1 deletions
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
index 332eb527ad0..f4c0f751d38 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
@@ -1,3 +1,7 @@
+2006-02-28 Peter Dennis Bartok <pbartok@novell.com>
+
+ * ComboBox.cs: Allow setting SelectedIndex to -1. Fixes #77665
+
2006-02-28 Alexander Olk <alex.olk@googlemail.com>
* FontDialog.cs:
diff --git a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
index 48e4d9c297d..0ed21f71af4 100644
--- a/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
+++ b/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
@@ -435,7 +435,11 @@ namespace System.Windows.Forms
selected_index = value;
if (dropdown_style != ComboBoxStyle.DropDownList) {
- SetControlText (GetItemText (Items[selected_index]));
+ if (selected_index != -1) {
+ SetControlText (GetItemText (Items[selected_index]));
+ } else {
+ SetControlText("");
+ }
}
OnSelectedIndexChanged (new EventArgs ());