2007-04-02 Jonathan Pobst <monkey@jpobst.com>
[mono.git] / mcs / class / Managed.Windows.Forms / System.Windows.Forms / ContainerControl.cs
index 4e9525087651347fdb279f270805ee12192bd6d0..7483eeda8efa70ace9daeb4793cf662b6964fb14 100644 (file)
@@ -69,7 +69,7 @@ namespace System.Windows.Forms {
                        }
 
                        set {
-                               if (value==null || (active_control == value)) {
+                               if (value==null || (active_control == value && active_control.Focused)) {
                                        return;
                                }
 
@@ -393,6 +393,16 @@ namespace System.Windows.Forms {
                        OnBindingContextChanged (EventArgs.Empty);
                }
 
+#if NET_2_0
+               protected override bool ProcessCmdKey (ref Message msg, Keys keyData)
+               {
+                       if (ToolStripManager.ProcessCmdKey (ref msg, keyData) == true)
+                               return true;
+                               
+                       return base.ProcessCmdKey (ref msg, keyData);
+               }
+#endif
+
                [EditorBrowsable (EditorBrowsableState.Advanced)]
                protected override bool ProcessDialogChar(char charCode) {
                        if (GetTopLevel()) {
@@ -532,15 +542,16 @@ namespace System.Windows.Forms {
                        base.OnFontChanged (e);
                }
 
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
                protected override void OnLayout (LayoutEventArgs levent)
                {
                        base.OnLayout (levent);
                }
                
                AutoValidate auto_validate = AutoValidate.Inherit;
+
                [Browsable (false)]
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
+               [AmbientValue (AutoValidate.Inherit)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public virtual AutoValidate AutoValidate {
                        get {
                                return auto_validate;
@@ -565,7 +576,7 @@ namespace System.Windows.Forms {
                }
 
                [Browsable (false)]
-               [EditorBrowsable (EditorBrowsableState.Advanced)]
+               [EditorBrowsable (EditorBrowsableState.Never)]
                public event EventHandler AutoValidateChanged {
                        add { Events.AddHandler (OnValidateChanged, value); }
                        remove { Events.RemoveHandler (OnValidateChanged, value); }