我看别人的窗体是一点一点展开的
而不是一下子出来
我想知道是如何实现的的

解决方案 »

  1.   


    //在窗体上放个Timer控件
    private void Form1_Load(object sender, EventArgs e)
    {
        this.StartPosition = FormStartPosition.CenterParent;
        this.Size = new Size(130, 40);
        this.timer1.Interval = 5;
        this.timer1.Start();
    }private void timer1_Tick(object sender, EventArgs e)
    {
        if (this.Width < 600)
        {
            this.Size = new Size(this.Size.Width + 10, this.Height + 10);
            this.Location = new Point((Screen.PrimaryScreen.Bounds.Width - this.Size.Width) / 2, (Screen.PrimaryScreen.Bounds.Height - this.Size.Height) / 2);
            return;
        }
        this.timer1.Stop();
    }
      

  2.   

    WPF支持这种动画,不需要timer之类的。