using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication3
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
/// <summary>
/// timer事件
/// </summary>
int i = 0;
private void timer1_Tick(object sender, EventArgs e)
{
i++;
this.progressBar1.Value = i;
if (progressBar1.Value == 100)
{
i = 0;
timer1.Stop();
MessageBox.Show("您已完成更新!");
}
}
/// <summary>
/// 点击升级
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
timer1.Enabled = true;
}
}
}