private void WmActivate (ref Message m)
{
if (!this.Enabled && modal_dialogs.Count > 0)
{
(modal_dialogs[modal_dialogs.Count -1] as Form).Activate ();
return; // prevent Activating of disabled form.
}
if (m.WParam != (IntPtr)WindowActiveFlags.WA_INACTIVE) {
if (is_loaded) {
SelectActiveControl ();
if (ActiveControl != null && !ActiveControl.Focused)
SendControlFocus (ActiveControl);
}
IsActive = true;
} else {
if (XplatUI.IsEnabled (Handle) && XplatUI.GetParent (m.LParam) != Handle)
ToolStripManager.FireAppFocusChanged (this);
IsActive = false;
}
}