Author: jpobst
Date: 2007-03-29 13:28:29 -0500 (Thu, 29 Mar 2007)
New Revision: 75165

Modified:
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
   trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
Log:
2007-03-29  Jonathan Pobst  <[EMAIL PROTECTED]>

        * ComboBox.cs: Override the ComboListBox's ActivateOnShow property and
        remove WS_VISIBLE from CreateParams to prevent combobox dropdowns from
        stealing focus from the active form on Windows.  (Control will be made
        visible in ShowWindow.)

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-29 18:11:51 UTC (rev 75164)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ChangeLog        
2007-03-29 18:28:29 UTC (rev 75165)
@@ -1,3 +1,10 @@
+2007-03-29  Jonathan Pobst  <[EMAIL PROTECTED]>
+
+       * ComboBox.cs: Override the ComboListBox's ActivateOnShow property and
+       remove WS_VISIBLE from CreateParams to prevent combobox dropdowns from
+       stealing focus from the active form on Windows.  (Control will be made
+       visible in ShowWindow.)
+
 2007-03-29  Mike Kestner  <[EMAIL PROTECTED]>
 
        * ImageList.cs : add internal Changed event.

Modified: trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs
===================================================================
--- trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2007-03-29 18:11:51 UTC (rev 75164)
+++ trunk/mcs/class/Managed.Windows.Forms/System.Windows.Forms/ComboBox.cs      
2007-03-29 18:28:29 UTC (rev 75165)
@@ -1902,6 +1902,8 @@
                                        return owner.Focused;
                                }
                        }
+                       
+                       internal override bool ActivateOnShow { get { return 
false; } }
                }
 
                internal class ComboListBox : Control
@@ -1995,8 +1997,9 @@
                                        if (owner == null || 
owner.DropDownStyle == ComboBoxStyle.Simple)
                                                return cp;
 
-                                       cp.Style ^= (int) WindowStyles.WS_CHILD;
-                                       cp.Style |= (int) WindowStyles.WS_POPUP;
+                                       cp.Style ^= (int)WindowStyles.WS_CHILD;
+                                       cp.Style ^= 
(int)WindowStyles.WS_VISIBLE;
+                                       cp.Style |= (int)WindowStyles.WS_POPUP;
                                        cp.ExStyle |= (int) 
WindowExStyles.WS_EX_TOOLWINDOW | (int) WindowExStyles.WS_EX_TOPMOST;
                                        return cp;
                                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to