把图片用ImageBox 装起来然后加滚动条了。

解决方案 »

  1.   

    用一个picturebox装起来,把他的autosize设置为true
    dim x1 ,y1 as Integer
    dim ifmove as boolen
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    If Button = vbLeftButton Then
         x1 = X
         y1 = Y
         ifmove = True
    End If
    End Sub
    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If ifmove Then
            Picture1.Left = Picture1.Left - x1 + X
            Picture1.Top = Picture1.Top - y1 + Y
        End If
    End Sub
    Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
        ifmove = False
    End Sub
    以上代码可实现用鼠标拖拉图片。