2006-06-26 Mike Kestner <mkestner@novell.com>
authorMike Kestner <mkestner@gmail.com>
Mon, 26 Jun 2006 17:11:59 +0000 (17:11 -0000)
committerMike Kestner <mkestner@gmail.com>
Mon, 26 Jun 2006 17:11:59 +0000 (17:11 -0000)
* ComboBox.cs: only do Keypress handling in the combo when there
are items in the collection. Fixes #78710.

svn path=/trunk/mcs/; revision=62057

mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs

index 6e0e11a65455bce0702e807325f562e809d28ef0..78a5ad13214a88160933aa44edd03df237f2944b 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-26  Mike Kestner  <mkestner@novell.com>
+
+       * ComboBox.cs: only do Keypress handling in the combo when there  
+       are items in the collection. Fixes #78710.
+
 2006-06-26  Chris Toshok  <toshok@ximian.com>
 
        * Binding.cs: make this work bi-directionally.  also, clear up
index f9ab337604ba63325d3f52ace8fe726edb6152d8..6ee911ae53fd3c22e4d4eaa0d1699d7e3e562f5b 100644 (file)
@@ -1066,6 +1066,9 @@ namespace System.Windows.Forms
 
                private void OnKeyDownCB(object sender, KeyEventArgs e)
                {
+                       if (Items.Count == 0)
+                               return;
+
                        switch (e.KeyCode) 
                        {                       
                                case Keys.Up: