using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;namespace NewAnalyze
{
/// <summary>
/// SplashForm 的摘要说明。
/// </summary>
public class SplashForm : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label label1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null; public SplashForm()
{
//
// 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()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(SplashForm));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
// 
// pictureBox1
// 
this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill;
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(392, 296);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
// 
// label1
// 
this.label1.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.label1.Location = new System.Drawing.Point(216, 280);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(184, 16);
this.label1.TabIndex = 1;
this.label1.Text = "IIS LogFile分析软件   Ver1.0";
// 
// SplashForm
// 
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(392, 296);
this.Controls.Add(this.label1);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "SplashForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "SplashForm";
this.TopMost = true;
this.ResumeLayout(false); }
#endregion
}
}
在主窗体上
private void DisplayForm_Load(object sender, System.EventArgs e)
{
SplashScreen=new SplashForm();
SplashScreen.Show(); //SplashScreen.lblStatus.Text = "Helpful information here";
//SplashScreen.lblStatus.Refresh();

this.timer1.Start();
} private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
this.SplashScreen.Close();
}