using System;
using System.Windows.Forms;
namespace Test_04_进度条_
{
public partial class My_Frm04 : Form
{
public My_Frm04()
{
InitializeComponent();
}
private void btnOK_Click(object sender, EventArgs e)
{
this.timer1.Enabled = true; //启用时间控件
}
private void timer1_Tick(object sender, EventArgs e)
{
this.progressBar1.Value += 10; //进度条变化
if (this.progressBar1.Value == 100) //达到100时发生
{
this.timer1.Enabled = false;//关闭时间控件
MessageBox.Show("游戏载入成功");
Form1 f = new Form1(); //切换窗体
this.Hide();
f.Show();
}
}
}
}