求一个进度条和Timer结合的小例子 如题我主要是不知道他们两个怎么结合的用的,随便举个简单的例子,有个注释,能看懂就给分多多益善!谢谢! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Form上放置timer和Progressbar控件后,复制以下代码,运行试试看using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Forms;namespace WindowsApplication1{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void timer1_Tick(object sender, EventArgs e) { if (this.progressBar1.Value < this.progressBar1.Maximum) this.progressBar1.Value += 1; else this.progressBar1.Value = this.progressBar1.Minimum; } private void Form1_Load(object sender, EventArgs e) { this.timer1.Interval = 100; this.timer1.Start(); } }} private void button1_Click(object sender, EventArgs e) { this.progressBar1.Maximum = 100; this.progressBar1.Step = 1; this.timer1.Start(); } private void timer1_Tick(object sender, EventArgs e) { this.progressBar1.Value = this.progressBar1.Value + 1; if (this.progressBar1.Value == this.progressBar1.Maximum) { this.timer1.Stop(); } } 在线等 mvc3 Razor变量赋值 不能给客户端给label赋值??? 请求帮忙 各位 大神如何生成一段IP数字 再问C#动态强制类型转换 winfrom 如何用一台电脑控制多台打印机 DataGridView绑定 [90吉利] 请问在Main方法赋值,如何在其它类里引用 要写一组功能相同的控件要怎么写 (菜鸟问题)在工具栏事件处理中如何调用菜单处理程序,请帮忙,来者有分 如何在窗体之间传值?在线等....... vs2008里面自代的水晶报表如何购买呀??
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
} private void timer1_Tick(object sender, EventArgs e)
{
if (this.progressBar1.Value < this.progressBar1.Maximum)
this.progressBar1.Value += 1;
else
this.progressBar1.Value = this.progressBar1.Minimum;
} private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Interval = 100;
this.timer1.Start();
}
}
}
{
this.progressBar1.Maximum = 100;
this.progressBar1.Step = 1;
this.timer1.Start();
}
private void timer1_Tick(object sender, EventArgs e)
{
this.progressBar1.Value = this.progressBar1.Value + 1;
if (this.progressBar1.Value == this.progressBar1.Maximum)
{
this.timer1.Stop();
}
}