Results 1 to 3 of 3

Thread: Moving an Image

  1. #1
    New Member
    Join Date
    Apr 00
    Posts
    10

    Question

    Hi,

    I have a program where I want to move the Image on the form, for example if the image is to large for the screen i want to click on the image and move the image with the mouse instead of having scroolbars. Do anyone know how it's done. I have made it with POINTAPI but the image updates so slow and it flickers. Do someone know of a better way?

  2. #2
    Guest
    Code:
    Dim OldX As Single
    Dim OldY As Single
    
    Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = 1 Then
            OldX = X
            OldY = Y
        End If
    End Sub
    
    Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
        If Button = vbLeftButton Then Picture1.MOVE Picture1.Left + (X - OldX), Picture1.Top + (Y - OldY)
    End Sub

  3. #3
    Cyberman Lord Orwell's Avatar
    Join Date
    Feb 01
    Location
    Elberfeld, IN
    Posts
    7,424
    make sure auto-resize is set to true, and that should work.
    John Lord, Evansville Indiana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •