Generated Image

如何使用进度条控件

我们来看下截图


在窗体中我们添加 4个 ProgressBar

从上到下依次为

ProgressBar1,ProgressBar2,ProgressBar3,ProgressBar4

并且 都将其属性Maxmum 设置为20

 再来看下代码

代码中使用了4层For循环嵌套语句

Private temp As Int32 '设置一个全局的变量 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim i, j, k, l As Int16 temp = 0 For i = 0 To 20 ProgressBar1.Value = i Label1.Text = i For j = 0 To 20 ProgressBar2.Value = j Label2.Text = j For k = 0 To 20 ProgressBar3.Value = k Label3.Text = k For l = 0 To 20 ProgressBar4.Value = l Label4.Text = l Me.Refresh() temp = temp + 1 Next Next Next Next End Sub

 

再看下

Public Property Value() As Integer 成员属于: System.Windows.Forms.ProgressBar 摘要: 获取或设置进度栏的当前位置。

 

 

Public Structure Int32 成员属于: System 摘要: 表示 32 位有符号的整数。
posted @ 2007-02-04 01:35  桂圆  阅读(772)  评论(0编辑  收藏  举报