Hi jfrazier, welcome to the forums.
You can code the Click event subs of the buttons to change the ZoomFactor property. You could add/subtract to the present zoom factor or multiply/divide it; that's a matter of your own design. Alternatively you could use a number of buttons each to set a specific value of the ZoomFactor (1 means original image size). As an example, suppose you add a "Zoom In" button to the form. Then double click the button and put this in its Click event sub (assuming the ZoomPictureBox is named zpb1):
And you could put something similar but with a factor of say 0.75 in the "Zoom Out" button's Click sub.Code:zpb1.ZoomFactor * = 1.25
The scroll wheel zooming will still work as long as you don't change EnableMouseWheelZooming to False. If you are using ZoomMode "zoom to mouse position", that might look a little odd when you click a button to zoom. But it's easy to change the mode to CenterControl temporarily in the button's Click sub, for example:
BBCode:zpb1.ZoomMode = ZPBLibrary.ZoomPictureBox.ZoomType.ControlCenter zpb1.ZoomFactor *= 1.25 zpb1.ZoomMode = ZPBLibrary.ZoomPictureBox.ZoomType.MousePosition




Reply With Quote