首页 > 其他 > 详细

splash简单示例

时间:2016-07-15 00:13:45      阅读:263      评论:0      收藏:0      [点我收藏+]

第一个类

public class HCSplash
{
  private Form2 m_Form = new Form2();

  public void Start()
  {
    DateTime dtStart = DateTime.Now;

  Thread t = new System.Threading.Thread(new ThreadStart(delegate
  {
    m_Form.ShowDialog();
  }));
  t.Start();

  Thread.Sleep(5000);
  }

  public void Stop()
  {
    m_Form.KillMe();
  }
}

 

 

第二个类

public partial class Form2 : Form
{
  public Form2()
  {
    InitializeComponent();
  }

  private void Form2_Load(object sender, EventArgs e)
  {
    this.timer1.Start();
  }

  public void KillMe()
  {
    this.BeginInvoke(new MethodInvoker(delegate
    {
      this.Close();
    }));
  }

  private void timer1_Tick(object sender, EventArgs e)
  {
    this.progressBar1.Value += 10;

    if (this.progressBar1.Value >= this.progressBar1.Maximum)
    {
      this.progressBar1.Value = this.progressBar1.Minimum;
    }
  }

}

 

技术分享

splash简单示例

原文:http://www.cnblogs.com/LongHuaiYu/p/5671853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!