-
centering a picture
Does anyone know how to center a picture on a form every time it changes size? I could tell it the left and top every time but that would be incredibly tedious. At the moment I have 'next' and 'previous' that change the picture in the frame but each pic is a different size. Any help would be appreciated!
-
Re: centering a picture
Set the Picturebox AutoSize Property to True, then in the Picturebox Resize Event, place the code to center it on the Form, eg.
private Sub Picture1_Resize()
DoEvents
Picture1.Move (ScaleWidth - Picture1.Width)/2, (ScaleHeight - Picture1.Height)/2
End Sub
Aaron Young
Analyst Programmer
[email protected]
[email protected]