vb6,加了滚动条控制图片框的移动,但只有滚动条可以控制图片框,如何让图片框的移动反应在滚动条上?
1个回答
展开全部
简单举例如下,自己举一反三。
Private Sub Form_Load()
Timer1.Interval = 100
HScroll1.Max = 10000
HScroll1.Min = 0
End Sub
Private Sub Timer1_Timer()
Picture1.Left = Picture1.Left + 50
If Picture1.Left > 10000 Then Timer1.Enabled = False: Exit Sub
HScroll1.Value = Picture1.Left
End Sub
Private Sub Form_Load()
Timer1.Interval = 100
HScroll1.Max = 10000
HScroll1.Min = 0
End Sub
Private Sub Timer1_Timer()
Picture1.Left = Picture1.Left + 50
If Picture1.Left > 10000 Then Timer1.Enabled = False: Exit Sub
HScroll1.Value = Picture1.Left
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询