示例#1
0
        private void Timer1_Tick(object sender, EventArgs e)
        {
            switch (this.action)
            {
            case frmAlert.actionEnum.wait:
                this.Timer1.Interval = 5000;
                this.action          = frmAlert.actionEnum.close;
                break;

            case frmAlert.actionEnum.start:
                this.Timer1.Interval = 1;
                this.Opacity        += 0.1;
                if (this.x < this.Location.X)
                {
                    this.Left--;
                }
                else
                {
                    if (this.Opacity == 1.0)
                    {
                        this.action = frmAlert.actionEnum.wait;
                    }
                }
                break;

            case frmAlert.actionEnum.close:
                this.Timer1.Interval = 1;
                this.Opacity        -= 0.1;

                this.Left -= 3;
                if (base.Opacity == 0.0)
                {
                    base.Close();
                }
                break;
            }
        }
示例#2
0
 private void GunaPictureBox2_Click(object sender, EventArgs e)
 {
     this.Timer1.Interval = 1;
     this.action          = frmAlert.actionEnum.close;
 }