C#渐变窗体(让窗体慢慢出现)

【转载】

public partial class Form1 : Form


    {

      public Form1()

        {

            InitializeComponent();

        }

        private void timer1_Tick(object sender, EventArgs e)

        {

            if (this.Opacity > 0.1)

            {

                this.Opacity = this.Opacity - 0.02;

            }

            else

            {

                this.timer1.Enabled = false;

                Close();

            }

        }

        private void Form1_Load(object sender, EventArgs e)

        {

            this.timer1.Enabled = true;

            this.Opacity = 0.99;

        }

    }

 

posted on 2013-11-27 16:53  MasonChi  阅读(274)  评论(0编辑  收藏  举报

导航