怎么用VB中的时钟,在一个框里实现两张图片的上下无缝滚动
Dim v1 As Integer, v2 As Integer
Private Sub Form_Click()
Timer1.Enabled = Not Timer1.Enabled
End Sub
Private Sub Form_Load()
Timer1.Enabled = True
Image1.Top = 0
Image2.Top = Picture1.Height - Image2.Height
Timer1.Interval = 1
v1 = 25
v2 = 25
End Sub
Private Sub Timer1_Timer()
If Image1.Top >= Picture1.Height - Image1.Height And v1 > 0 Or Image1.Top <= 0 And v1 < 0 Then v1 = -v1
If Image2.Top >= Picture1.Height - Image2.Height And v2 > 0 Or Image2.Top <= 0 And v2 < 0 Then v2 = -v2
Image1.Top = Image1.Top + v1
Image2.Top = Image2.Top + v2
End Sub