www.pudn.com > Splash.zip > frmSplash.cs
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
namespace Splash
{
///
/// frmSplash 的摘要说明。
///
public class frmSplash : System.Windows.Forms.Form
{
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label labStatus;
private string _StatusInfo = "";
///
/// 必需的设计器变量。
///
private System.ComponentModel.Container components = null;
public frmSplash()
{
//
// Windows 窗体设计器支持所必需的
//
InitializeComponent();
//
// TODO: 在 InitializeComponent 调用后添加任何构造函数代码
//
}
///
/// 清理所有正在使用的资源。
///
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Windows 窗体设计器生成的代码
///
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
///
private void InitializeComponent()
{
System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(frmSplash));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.labStatus = new System.Windows.Forms.Label();
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(512, 384);
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// labStatus
//
this.labStatus.AutoSize = true;
this.labStatus.BackColor = System.Drawing.Color.White;
this.labStatus.Location = new System.Drawing.Point(24, 360);
this.labStatus.Name = "labStatus";
this.labStatus.Size = new System.Drawing.Size(0, 17);
this.labStatus.TabIndex = 1;
//
// frmSplash
//
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(512, 384);
this.Controls.Add(this.labStatus);
this.Controls.Add(this.pictureBox1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "frmSplash";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.ResumeLayout(false);
}
#endregion
public string StatusInfo
{
set
{
_StatusInfo = value;
ChangeStatusText();
}
get
{
return _StatusInfo;
}
}
public void ChangeStatusText()
{
try
{
if (this.InvokeRequired)
{
this.Invoke(new MethodInvoker(this.ChangeStatusText));
return;
}
labStatus.Text = _StatusInfo;
}
catch (Exception e)
{
// 异常处理
}
}
}
}