A = 0
A = A + 1
假如 A 等於 1 就執行 HScroll1.Value 0 到 10000
接著
A = A - 1
假如 A 等於 0 就執行 HScroll1.Value 10000 到 0
請問該如何讓這兩行一直循環呢?
若有打錯,請幫忙糾正。
2006-12-22 16:30:24 · 1 個解答 · 發問者 MK 2 in 電腦與網際網路 ➔ 程式設計
'版本VB6.0
圖片參考:http://tw.yimg.com/i/tw/blog/smiley/1.gif
Dim B As Boolean
Private Sub Command1_Click()
Dim A As Byte
HScroll1.Min = 0
HScroll1.Max = 10000
Do
If A = 0 Then
A = A + 1
For I = 0 To 10000
HScroll1 = I
Next
Else
A = A - 1
For I = 10000 To 0 Step -1
HScroll1 = I
Next
End If
DoEvents
Loop Until B
End Sub
Private Sub Form_Unload(Cancel As Integer)
B = True
End Sub
2006-12-23 06:43:56 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋