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 WindowsFormsApplication2 { public partial class Form1 : Form { public Form1() {
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;namespace WindowsFormsApplication2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.timer1.Start();
this.progressBar1.Maximum = 5;
this.progressBar1.Minimum = 0;
} //timer触发事件
private void timer1_Tick(object sender, EventArgs e)
{
if (progressBar1.Value <5)
{
progressBar1.Value++;
}
if (progressBar1.Value == progressBar1.Maximum)
{
timer1.Stop();
this.progressBar1.Visible = false;
button1_Click(this,e);
} }
/// <summary>
/// 这是button1事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show("nihao!");
}
}
}你试试可以不?
ProgressBar1.Value = 1;
timer21Start();
private void timer1_Tick(object sender, EventArgs e)
{
ProgressBar1.Value --;
this.progressBar1.Update();
}
http://topic.csdn.net/u/20090918/09/09ab6dd5-f72a-434f-a724-9af5d856825f.html