用2个picture控件,一个做容器,一个放图片,
加二个滚动条一个垂直,一个水平
Private Sub Form_Load()
Picture2.Top = 0
Picture2.Left = 0
'设置滚动条的最大值
HScroll1.Max = Picture2.Width - Picture1.Width
If Picture2.Width < Picture1.Width Then
HScroll1.Visible = False
End If
VScroll1.Max = Picture2.Height - Picture1.Height
End Sub
Private Sub VScroll1_change()
Picture2.Top = -VScroll1.Value
End Sub
Private Sub HScroll1_change()
Picture2.Left = -HScroll1.Value
End Sub