日期:2014-05-17  浏览次数:20818 次

怎么实现一个窗体,由下到上消失,或者由上到下消失。
之前通过透明设置能控制整体渐变。
但是怎么实现上下渐变,或者左右渐变,这种自定义的渐变效果呢。

------解决方案--------------------
LinearGradientBrush
http://www.csharpwin.com/csharpspace/9197r5587.shtml
------解决方案--------------------
搜索winform 渐出效果
http://www.cnblogs.com/JieNet/archive/2008/05/27/1208651.html
------解决方案--------------------
http://www.codeproject.com/Articles/13288/Animating-Windows-Forms

修改源码  可以到达你要的效果
------解决方案--------------------

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;


namespace 水果机
{
    public partial class login : Form
    {
        public login()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Form1 frm = new Form1();
            frm.ShowDialog();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            answer frm = new answer();
            frm.ShowDialog();
        }
        double i = 0.05;
        FormShow fs = new FormShow();