怎样用 VB 制作个简单的小程序

2024-11-24 02:19:35
推荐回答(1个)
回答1:

form1上放置Command1,Timer1,Picture1(装入一个图片)

Dim MoveStep As Integer

Private Sub Command1_Click()
Timer1.Enabled = False
End Sub
Private Sub Form_Load()
MoveStep = 100
End Sub

Private Sub Timer1_Timer()
If Picture1.Left + Picture1.Width + 30 > Form1.Width Then
MoveStep = -100
End If
If Picture1.Left < 0 Then
MoveStep = 100
End If
Picture1.Left = Picture1.Left + MoveStep
End Sub