📄 start.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace 中小型企业管理系统
{
/// <summary>
/// Start 的摘要说明。
/// </summary>
public class Start : System.Windows.Forms.Form
{
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components;
private bool isAllShow = false;
public Start()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Start));
this.timer1 = new System.Windows.Forms.Timer(this.components);
//
// timer1
//
this.timer1.Interval = 40;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// Start
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("$this.BackgroundImage")));
this.ClientSize = new System.Drawing.Size(504, 414);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.MinimizeBox = false;
this.Name = "Start";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Start";
this.Load += new System.EventHandler(this.Start_Load);
}
#endregion
private void Start_Load(object sender, System.EventArgs e)
{
this.Opacity=0.0;
this.timer1.Start();//设置窗体界面透明度为0,启动时间控件
}
private void timer1_Tick(object sender, System.EventArgs e)
{
if(isAllShow) //窗体全部显示后,透明度从1---0的变化
{
double d = 100.0/this.timer1.Interval/100.0;
if(this.Opacity <=0.0)
{
this.Opacity = 0.0;
this.timer1.Stop();
this.Close ();
}
else
{
this.Opacity -= d;
}
}
else //窗体的透明度从0--1开始
{
double d = 100.0/this.timer1.Interval/100.0;
if(this.Opacity >=1.0)
{
this.Opacity = 1.0;
isAllShow = true;
}
else
{
this.Opacity += d;
}
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -