vb中用设计一个进度条,一按command,进度条开始工作
发布网友
发布时间:2024-05-29 10:18
我来回答
共2个回答
热心网友
时间:2024-06-02 19:02
Private Sub Command1_Click()
Dim Counter As Integer
Dim Workarea(25000) As String
ProgressBar1.Min = LBound(Workarea)
ProgressBar1.Max = UBound(Workarea)
ProgressBar1.Visible = True
ProgressBar1.Value = ProgressBar1.Min
For Counter = LBound(Workarea) To UBound(Workarea)
Workarea(Counter) = "lintial value" & Counter
ProgressBar1.Value = Counter
Next Counter
End Sub
将ProgressBar1控件的Visible 设为False
热心网友
时间:2024-06-02 18:57
1.首先添加microsoft window common Cortrols 6.0部件;
2.在控件工具箱中点ProgressBar,在窗体中放置一个滚动条,命名为字pb1;
3.在窗体中放置一个命令按钮;
4.在窗体上在放置一个计时器控件,命名为T1;
代码如下:
Dim i As Integer
Private Sub Command1_Click()
T1.Interval = 1000
i = 10
End Sub
Private Sub T1_Timer()
If i < 100 Then
pb1.Value = i
i = i + 10
End If
End Sub