Click to See Complete Forum and Search --> : Scroll bars for Pictur Box?


srihariacha
May 27th, 2008, 09:32 PM
Can any one tell me how to add Scroll Bars to Picture Box?
Thanks in advance.

riscutiavlad
May 28th, 2008, 03:11 AM
Use HScrollBar and VScrollBar objects. You can link them to the PictureBox like this:

First, whenever you load a picture - set the dimensions of the scroll bars or enable/disable them.

Implement your custom paint method so that the image inside the picture box is drawn at coordinates that depend on the values of the scroll bars.

Whenever a scroll bar receives a scroll event, refresh the picture box.