zoukankan      html  css  js  c++  java
  • 窗口渐变

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

    namespace SplashScreen
    {
        public partial class SplashScreen : Form
        {
            public SplashScreen()
            {
                InitializeComponent();
            }
            private bool isFade = true;

            private void SplashScreen_Load(object sender, EventArgs e)
            {
                this.ClientSize = this.BackgroundImage.Size;

                this.Opacity = 0;

                this.timer1.Interval = 100;

                this.timer1.Enabled = true;

                this.timer1.Start();

            }

            private void timer1_Tick(object sender, EventArgs e)
            {
                if (isFade)
                {
                    this.Opacity += 0.01;//当透明变为不透明

                    if (this.Opacity >= 1)//当完全不透明时再由不透明变为透明
                    {
                        this.timer1.Stop();
                        isFade = false;
                    }
                }
                else
                {
                    this.Opacity -= 0.01;//由不透明变为透明

                    if (this.Opacity <= 0)//当完全透明时停止计时器,并退出欢迎界面。
                    {
                        this.timer1.Stop();
                        this.Close();
                    }
                }

            }
        }
    }

  • 相关阅读:
    [Django学习]Ajax访问静态页面
    [Django学习]分页
    [Django学习]上传图片
    nginx的location配置详解
    php中二维数组排序问题方法详解
    angularjs 本地数据存储LocalStorage
    AngularJS通过$location获取及改变当前页面的URL
    socket()函数介绍
    AngularJS判断checkbox/复选框是否选中并实时显示
    ThinkPHP函数详解:M方法
  • 原文地址:https://www.cnblogs.com/jcomet/p/1251144.html
Copyright © 2011-2022 走看看