void objPreview_Click(object sender, EventArgs e) { ThemePreview objPreview = (ThemePreview)sender; Point OverlayOrigin = new Point(); OverlayOrigin = Cursor.Position; ColorOverlay objOverlay = new ColorOverlay(OverlayOrigin, objPreview.getColorSchemePreset(), _BaseForm, _Parent); objOverlay.FormClosed += objOverlay_FormClosed; objOverlay.Show(); }
private void tgl_Theme_onAnimationFinished() { if (Ignore) { Ignore = false; return; } Point OverlayOrigin = new Point(); OverlayOrigin.X = tgl_Theme.Checked ? tgl_Theme.Right - tgl_Theme.Height / 2 : tgl_Theme.Left + tgl_Theme.Height / 2; OverlayOrigin.Y = tgl_Theme.Location.Y + tgl_Theme.Height / 3; ColorOverlay objOverlay = new ColorOverlay(PointToScreen(OverlayOrigin), (tgl_Theme.Checked ? MaterialSkinManager.Themes.DARK : MaterialSkinManager.Themes.LIGHT), _BaseForm, _Parent); objOverlay.FormClosed += objOverlay_FormClosed; objOverlay.Show(); }