Panel1 scroll bars ... Hide them but still be able to scroll my image that is in Picturebox

I use VB 2008 Express

What I have and what I need

Panel called Panel1
Picturebox called PictureBox1

Picturebox1 is within Panel1 ...... Picturebox1 contains a map image of which I can grab an scroll the image like you can in Google Maps
I want to do 2 things

1.  I want the scroll bars that are showing to not show .... so that I can still scroll by grabing the image of which I already have the code in place to do I just want the scroll bars gone ... is there an override that will tell the panel not to draw them?

2. I want to click on spot and the image in the picturebox1 that is in the panel1 scroll to clicked position

Who is Participating?
Mike TomlinsonMiddle School Assistant TeacherCommented:
You are setting the AutoScrollPosition to move the Image so you can't turn off the SrollBars.

If you want to be able to move it without scrollbars then you'll need to write custom code to manually adjust the Location() Property of your PictureBox as the mouse is moved....
Mike TomlinsonMiddle School Assistant TeacherCommented:
It really depends on how you are currrently allowing the user to "pan" the image.  Have you tried setting the Panels AutoScroll() Property to False?
vbMarkOAuthor Commented:
Well here is a glimps of how they are doing it .....

Maybe this will tell you enough
If e.Button = Windows.Forms.MouseButtons.Left Then
            'Here we get the change in coordinates.
            Dim DeltaX As Integer = (m_PanStartPoint.X - e.X)
            Dim DeltaY As Integer = (m_PanStartPoint.Y - e.Y)
            'Then we set the new autoscroll position.
            'ALWAYS pass positive integers to the panels autoScrollPosition method
            Panel1.AutoScrollPosition = _
            New Drawing.Point((DeltaX - Panel1.AutoScrollPosition.X), _
            (DeltaY - Panel1.AutoScrollPosition.Y))
        End If

Open in new window

vbMarkOAuthor Commented:
Ok, I could possibly live with the scrolls but 2nd part is how about user clicking on spot and the image center or scroll to the clicked position like in google    ... you click on a on image and the image centers on the new position

Anythoughts ....

vbMarkOAuthor Commented:
Going to live with the scroll bars for now ... thanx for the info
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.