vb的奇怪问题

来源:百度知道 编辑:UC知道 时间:2024/05/29 10:07:00
Dim counter As Integer
Dim workarea(250) As String
pubilc sub init_set()
ProgressBar1.Min = LBound(workarea)
ProgressBar1.Min = UBound(workarea)
ProgressBar1.Visible = True
ProgressBar1.Value = ProgressBar1.Min
End Sub

Private Sub Command1_Click()
init_set
For counter = LBound(workarea) To UBound(workarea)
workarea(counter) = "initial value" & counter
ProgressBar1.Value = counter
Next counter
ProgressBar1.Visible = False
ProgressBar1.Value = ProgressBar1.Min
End Sub

Private Sub Command2_Click()
int_set
For counter = LBound(workarea) To UBound(workarea)
If counter Mod 10 = 0 Then Print
Print workarea(counter);
ProgressBar1.Value = counter
Next counter
ProgressBar1.Visible = False
ProgressBar1.Value = ProgressBar1.Min

End Sub

Private Sub Form_Load()

ProgressBar1.Align = 2
Progr

pubilc sub init_set() '错误
public sub init_set() '正确
比较一下,就差一点,呵呵。
另外还有两个错误:
ProgressBar1.Min = LBound(workarea)
ProgressBar1.Min = UBound(workarea) '应该是max
ProgressBar1.Visible = True

Private Sub Command2_Click()
int_set '应该是init_set
For counter = LBound(workarea) To UBound(workarea)