📄 frmwelcome.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace FileSystem
{
/// <summary>
/// FrmWelcome 的摘要说明。
/// </summary>
public class FrmWelcome : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components;
private int step;
private int wait;
public FrmWelcome()
{
//
// 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(FrmWelcome));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(456, 344);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// timer1
//
this.timer1.Interval = 50;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick_1);
//
// FrmWelcome
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(448, 336);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "FrmWelcome";
this.Opacity = 0;
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "FrmWelcome";
this.Click += new System.EventHandler(this.FrmWelcome_Click);
this.Load += new System.EventHandler(this.FrmWelcome_Load);
this.ResumeLayout(false);
}
#endregion
private void FrmWelcome_Click(object sender, System.EventArgs e)
{
this.Close();
}
private void timer1_Tick_1(object sender, System.EventArgs e)
{
if(step==1)
{
this.Opacity+=0.04;
if(this.Opacity>=1)
{
step=2;
}
}
if(step==2)
{
wait+=1;
if(wait==10)
{
step=3;
}
}
if(step==3)
{
this.Opacity-=0.04;
if(this.Opacity<=0)
{
this.Close();
}
}
}
private void FrmWelcome_Load(object sender, System.EventArgs e)
{
step=1;
wait=0;
timer1.Enabled=true;
}
private void pictureBox1_Click(object sender, System.EventArgs e)
{
this.Close();
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -