📄 welcomeframe.cs
字号:
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace WindowsApplication
{
/// <summary>
/// WelcomeFrame 的摘要说明。
/// </summary>
public class WelcomeFrame : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox picImage;
private System.Windows.Forms.Label dataLabel;
private System.Windows.Forms.Label NetLabel;
private System.Windows.Forms.Label CompanyLabel;
private System.Windows.Forms.Timer timer;
private System.Windows.Forms.Label TitleLabel;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ToolTip toolTip;
private System.ComponentModel.IContainer components;
public WelcomeFrame()
{
//
// 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(WelcomeFrame));
this.picImage = new System.Windows.Forms.PictureBox();
this.dataLabel = new System.Windows.Forms.Label();
this.NetLabel = new System.Windows.Forms.Label();
this.CompanyLabel = new System.Windows.Forms.Label();
this.timer = new System.Windows.Forms.Timer(this.components);
this.TitleLabel = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.toolTip = new System.Windows.Forms.ToolTip(this.components);
this.SuspendLayout();
//
// picImage
//
this.picImage.BackColor = System.Drawing.Color.White;
this.picImage.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.picImage.Image = ((System.Drawing.Image)(resources.GetObject("picImage.Image")));
this.picImage.Location = new System.Drawing.Point(0, 40);
this.picImage.Name = "picImage";
this.picImage.Size = new System.Drawing.Size(176, 208);
this.picImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.picImage.TabIndex = 1;
this.picImage.TabStop = false;
//
// dataLabel
//
this.dataLabel.BackColor = System.Drawing.Color.White;
this.dataLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.dataLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.dataLabel.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
this.dataLabel.Location = new System.Drawing.Point(208, 120);
this.dataLabel.Name = "dataLabel";
this.dataLabel.Size = new System.Drawing.Size(160, 24);
this.dataLabel.TabIndex = 2;
this.dataLabel.Text = "数据库正在加载,请稍等...";
this.dataLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// NetLabel
//
this.NetLabel.BackColor = System.Drawing.Color.White;
this.NetLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.NetLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.NetLabel.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
this.NetLabel.Location = new System.Drawing.Point(200, 184);
this.NetLabel.Name = "NetLabel";
this.NetLabel.Size = new System.Drawing.Size(160, 24);
this.NetLabel.TabIndex = 3;
this.NetLabel.Text = "www.XinHua.com";
this.NetLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// CompanyLabel
//
this.CompanyLabel.BackColor = System.Drawing.Color.White;
this.CompanyLabel.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.CompanyLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.CompanyLabel.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(0)), ((System.Byte)(0)), ((System.Byte)(192)));
this.CompanyLabel.Location = new System.Drawing.Point(200, 64);
this.CompanyLabel.Name = "CompanyLabel";
this.CompanyLabel.Size = new System.Drawing.Size(168, 24);
this.CompanyLabel.TabIndex = 4;
this.CompanyLabel.Text = "青岛市新华易网络有限公司";
this.CompanyLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// timer
//
this.timer.Enabled = true;
this.timer.Interval = 300;
this.timer.Tick += new System.EventHandler(this.timer_Tick);
//
// TitleLabel
//
this.TitleLabel.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.TitleLabel.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.TitleLabel.Cursor = System.Windows.Forms.Cursors.Hand;
this.TitleLabel.Font = new System.Drawing.Font("宋体", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.TitleLabel.ForeColor = System.Drawing.Color.White;
this.TitleLabel.Location = new System.Drawing.Point(0, 0);
this.TitleLabel.Name = "TitleLabel";
this.TitleLabel.Size = new System.Drawing.Size(416, 40);
this.TitleLabel.TabIndex = 0;
this.TitleLabel.Text = "考勤管理系统";
this.TitleLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// label1
//
this.label1.BackColor = System.Drawing.Color.FromArgb(((System.Byte)(128)), ((System.Byte)(128)), ((System.Byte)(255)));
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label1.Cursor = System.Windows.Forms.Cursors.Hand;
this.label1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.label1.Font = new System.Drawing.Font("宋体", 10F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(134)));
this.label1.ForeColor = System.Drawing.Color.White;
this.label1.Location = new System.Drawing.Point(0, 248);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(424, 48);
this.label1.TabIndex = 5;
this.label1.Text = "Copyright @ 0532-88259060.com";
this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
//
// WelcomeFrame
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.BackColor = System.Drawing.SystemColors.ActiveCaptionText;
this.ClientSize = new System.Drawing.Size(416, 288);
this.Controls.Add(this.label1);
this.Controls.Add(this.CompanyLabel);
this.Controls.Add(this.NetLabel);
this.Controls.Add(this.dataLabel);
this.Controls.Add(this.picImage);
this.Controls.Add(this.TitleLabel);
this.Cursor = System.Windows.Forms.Cursors.WaitCursor;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "WelcomeFrame";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "WelcomeFrame";
this.toolTip.SetToolTip(this, "数据库正在加载...");
this.ResumeLayout(false);
}
#endregion
private void timer_Tick(object sender, System.EventArgs e)
{
try
{
if(this.Opacity==1)
{
this.dataLabel.Text+="...";
this.dataLabel.TextAlign=System.Drawing.ContentAlignment.MiddleCenter;
}
if(this.dataLabel.Text.Trim().Equals("数据库正在加载,请稍等......"))
{
this.dataLabel.Text="数据已经初始化完成...!";
System.Threading.Thread.Sleep(1000);
}
if(this.dataLabel.Text.Equals("数据已经初始化完成...!"))
{
this.Opacity=-0.1;
if(this.Opacity<0.2)
{
this.Visible=false;
this.Dispose();
}
}
}
catch(Exception exe)
{
exe.ToString();
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -