private void Timer_Tick(object sender, EventArgs e) { if (TimerMode == ShowHideMode.Show && this.Opacity == 1f) { TimerShowHide.Stop(); if (OnLoadEffectFinished != null) { OnLoadEffectFinished(this, EventArgs.Empty); } } else if (TimerMode == ShowHideMode.Hide && this.Opacity == 0.1f) { TimerShowHide.Stop(); } switch (TimerMode) { case ShowHideMode.Hide: this.Opacity -= 0.1f; break; case ShowHideMode.Show: this.Opacity += 0.1f; break; } }
protected override void OnClosed(System.EventArgs e) { timerDblClk.Stop(); TimerShowHide.Stop(); if (UseCloseEffect) { do { this.Opacity -= 0.1f; Threading.Thread.Sleep(20); } while (!(this.Opacity == 0f)); } base.OnClosed(e); }