By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,333 Members | 1,047 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,333 IT Pros & Developers. It's quick & easy.

Scrollbar Question

P: n/a
I have a form containing a panel and a picturebox inside the panel.
The form load code changes the panel size to 400x400 and the picturebox size
to 800x800
Autoscroll on the panel is set to true.
The picturebox sizemode is set to AutoSize and StretchImage
An image of size 400x400 is loadeded into the picturebox.
Everything works as expected.
I have also added the following code (see end of message).
The pagedown does shift the visible portion of the image in the picturebox
down as I want it to.
However, the bottom part of the vertical scrollbar on the right side of the
panel moves down correctly, but the top part of the scrollbar stays frozen
in place. This just makes the scrollbar appear too long and makes it
unusable for scrolling back to the top.
I'll be happy to email code if this question isn't clear.
Thanks in advance for any help.
Ron Dahl

Protected Overrides Function ProcessCmdKey(ByRef msg As
System.Windows.Forms.Message, _

ByVal keyData As System.Windows.Forms.Keys) As Boolean

Select Case keyData

Case Keys.PageUp

MyY += 50

Me.PictureBox1.Location = New Point(MyX, MyY)


Case Keys.PageDown

MyY -= 50

Me.PictureBox1.Location = New Point(MyX, MyY)


End Select

End Function
Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.