Make your own free website on Tripod.com

Stretch Picture Box

'Add 2 Picture Boxes To Your Form. Add picture to Picture1 Picture Box
'Add 1 Command Button to your form.
'The following sample will stretch the first Picture Box to the size of the second Picture Box.
'Insert the following code to your form:

Private Sub Command1_Click()
Picture1.AutoSize = True
Picture2.AutoRedraw = True
Picture2.PaintPicture Picture1.Picture, 0, 0, Picture2.ScaleWidth, Picture2.ScaleHeight, _
0, 0, Picture1.ScaleWidth, Picture1.ScaleHeight
End Sub

Go Back