private void PrepareForNewTheme() { if (base.Region != null) { base.Region.Dispose(); } base.Region = null; if (ControlBox) { controlBoxManager.ResetBoxColor(); controlBoxManager.FormResize(); } SetFormRegion(); //Padding = new Padding(0); base.BackColor = XTheme.FormBackColor; base.OnSizeChanged(EventArgs.Empty); SetFormMinimizeSize(); if (XTheme.ShowShadow) { if (_shawdowForm == null || _shawdowForm.IsDisposed) { OnActivated(EventArgs.Empty); } } else { if (_shawdowForm != null) { _shawdowForm.Close(); _shawdowForm = null; } } }
protected override void OnActivated(EventArgs e) { base.OnActivated(e); if (XTheme.ShowShadow && !base.IsMdiChild) { if (_shawdowForm == null) { _shawdowForm = new GMShadow(this); SetShadowFormSize(); SetShadowFormLocation(); _shawdowForm.Show(this); SetShadowFormSize(); SetShadowFormLocation(); _shawdowForm.TopMost = base.TopMost; var size = base.MinimumSize; size.Width += ShadowWidth * 2; size.Height += ShadowWidth * 2; _shawdowForm.MinimumSize = size; if (XTheme.UseShadowToResize) { _shawdowForm.BeginToResizeOwner(); } } } }