C# SplashScreen

原文:http://www.cnblogs.com/wuhuacong/archive/2009/07/08/1519309.html

  把文件拷贝到项目里,https://files.cnblogs.com/ike_li/MySplashScreen.rar

 直接就可以使用了

using System;
using System.Collections.Generic;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {

            //MySplashScreen
            MySplashScreen.Splasher.Show(typeof(MySplashScreen.frmSplash));

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

 

 

 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();

            //MySplashScreen
            MySplashScreen.Splasher.Status = "正在展示相关的内容";
            System.Threading.Thread.Sleep(9000);

            //此处省略部分加载耗时的代码

            MySplashScreen.Splasher.Status = "初始化完毕";
            System.Threading.Thread.Sleep(50);

            MySplashScreen.Splasher.Close();

        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }
    }
}

 

posted @ 2014-08-30 08:04  ike_li  阅读(742)  评论(0)    收藏  举报