Dim intStep As Integer Dim blnup As BooleanPrivate Sub Command1_Click()If Command1.Caption = "down" Then blnup = False Command1.Caption = "up" Else: blnup = True: Command1.Caption = "down" End If End SubPrivate Sub Form_Load() Timer1.Interval = 200 VScroll1.Max = 200 intStep = 100 blnup = True Command1.Caption = "down" End SubPrivate Sub Timer1_Timer() With Picture1 Select Case blnup Case True If .Top + .Height >= 0 Then .Move .Left, .Top - intStep Else .Move .Left, Me.ScaleHeight - .Height End If Case False If .Top <= Me.ScaleHeight Then .Move .Left, .Top + intStep Else .Move .Left, -.Height End If End Select End With End SubPrivate Sub VScroll1_Change() Timer1.Interval = VScroll1.Value End Sub你看看吧!会有用的
Dim intStep As Integer
Dim blnup As BooleanPrivate Sub Command1_Click()If Command1.Caption = "down" Then
blnup = False
Command1.Caption = "up"
Else: blnup = True: Command1.Caption = "down"
End If
End SubPrivate Sub Form_Load()
Timer1.Interval = 200
VScroll1.Max = 200
intStep = 100
blnup = True
Command1.Caption = "down"
End SubPrivate Sub Timer1_Timer()
With Picture1
Select Case blnup
Case True
If .Top + .Height >= 0 Then
.Move .Left, .Top - intStep
Else
.Move .Left, Me.ScaleHeight - .Height
End If
Case False
If .Top <= Me.ScaleHeight Then
.Move .Left, .Top + intStep
Else
.Move .Left, -.Height
End If
End Select
End With
End SubPrivate Sub VScroll1_Change()
Timer1.Interval = VScroll1.Value
End Sub你看看吧!会有用的