📄 frmsplash.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace OES
{
public class frmSplash : System.Windows.Forms.Form
{
private System.Windows.Forms.Timer timer1;
private System.ComponentModel.IContainer components;
private System.Windows.Forms.ProgressBar procSplash;
private System.Windows.Forms.PictureBox pcbSplash;
private int TIM = 0;
public frmSplash()
{
InitializeComponent();
}
[STAThread]
static void Main()
{
//Application.Run(new frmSplash());
Application.Run(new frmLogin());
}
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows Form Designer generated code
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmSplash));
this.pcbSplash = new System.Windows.Forms.PictureBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.procSplash = new System.Windows.Forms.ProgressBar();
this.SuspendLayout();
//
// pcbSplash
//
this.pcbSplash.BackColor = System.Drawing.SystemColors.HotTrack;
this.pcbSplash.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("pcbSplash.BackgroundImage")));
this.pcbSplash.Dock = System.Windows.Forms.DockStyle.Fill;
this.pcbSplash.Location = new System.Drawing.Point(0, 0);
this.pcbSplash.Name = "pcbSplash";
this.pcbSplash.Size = new System.Drawing.Size(558, 312);
this.pcbSplash.TabIndex = 0;
this.pcbSplash.TabStop = false;
this.pcbSplash.Click += new System.EventHandler(this.pcbSplash_Click);
//
// timer1
//
this.timer1.Enabled = true;
this.timer1.Interval = 30;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// procSplash
//
this.procSplash.Location = new System.Drawing.Point(47, 288);
this.procSplash.Name = "procSplash";
this.procSplash.Size = new System.Drawing.Size(464, 8);
this.procSplash.Step = 1;
this.procSplash.TabIndex = 1;
//
// frmSplash
//
this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
this.BackColor = System.Drawing.SystemColors.Info;
this.ClientSize = new System.Drawing.Size(558, 312);
this.ControlBox = false;
this.Controls.Add(this.procSplash);
this.Controls.Add(this.pcbSplash);
this.Font = new System.Drawing.Font("Times New Roman", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "frmSplash";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.ResumeLayout(false);
}
#endregion
private void timer1_Tick(object sender, System.EventArgs e)
{
TIM=TIM+1;
procSplash.Value =TIM;
this.procSplash.BackColor=SystemColors.Info ;
if (TIM == 100)
{
timer1.Enabled=false;
this.Hide();
this.showMessage();
}
}
private void showMessage()
{
frmLogin f = new frmLogin();
f.ShowDialog();
f.Refresh();
this.Close();
}
private void pcbSplash_Click(object sender, System.EventArgs e)
{
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -