VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



How to scroll the image with in picture box. Imagine a small frame where you have to fit a partial

by Daniel Nagdimunov (1 Submission)
Category: Graphics
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Wed 12th March 2003
Date Added: Mon 8th February 2021
Rating: (1 Votes)

How to scroll the image with in picture box. Imagine a small frame where you have to fit a partial picture of someone. You take the frame and

Rate How to scroll the image with in picture box. Imagine a small frame where you have to fit a partial



    Frame1.Caption = ""
    'Set picture box properties
    Picture1.AutoSize = True
    Picture1.Top = 0
    Picture1.Left = 0
    Picture1.Picture = LoadPicture("C:\mypicture.jpg")
    'Set vertical scroll bar properties
    VScroll1.Top = Frame1.Top
    VScroll1.Left = Frame1.Left + Frame1.Width
    VScroll1.Height = Frame1.Height
    VScroll1.Min = 0
    VScroll1.Max = Picture1.Height - Frame1.Height
    VScroll1.SmallChange = 50
    VScroll1.LargeChange = 100
    'Set horisontal scroll bar
    HScroll1.Left = Frame1.Left
    HScroll1.Top = Frame1.Top + Frame1.Height
    HScroll1.Width = Frame1.Width
    HScroll1.Min = 0
    HScroll1.Max = Picture1.Width - Frame1.Width
    HScroll1.SmallChange = 50
    HScroll1.LargeChange = 100
End Sub

Private Sub HScroll1_Change()
    Picture1.Left = HScroll1.Value * -1
End Sub

Private Sub VScroll1_Change()
    Picture1.Top = VScroll1.Value * -1
End Sub

Download this snippet    Add to My Saved Code

How to scroll the image with in picture box. Imagine a small frame where you have to fit a partial Comments

No comments have been posted about How to scroll the image with in picture box. Imagine a small frame where you have to fit a partial . Why not be the first to post a comment about How to scroll the image with in picture box. Imagine a small frame where you have to fit a partial .

Post your comment

Subject:
Message:
0/1000 characters