PDA

Click to See Complete Forum and Search --> : stupid question


Nov 30th, 1999, 06:32 AM
this is a stupid question but ill ask anyway. how do i make the form "wrap" around my picture box when i resize it during runtime?

for example: if i press a button that will randomly change the size of the picture box, and the form will resize also to be the same size as the picture box.

i have tried
form1.width = picture1.width
or even
form1.width = picture1.scalewidth
or anything similar to that but it makes it a little smaller then the picturebox so the picture gets "clipped".

so again how would i do this? also i dont want it to be exactly the same size, i want to be just a little bigger so it leaves a border around the picturebox.

thanx ahead of time

MicahCarrick
Nov 30th, 1999, 06:46 AM
Try this ... might work. Where BorderSize is however big you want that border.

Private Sub Picture1_Resize()
Dim BorderSize as Integer
BorderSize = 50

Form1.ScaleWidth = Picture1.ScaleWidth + (2 * BorderSize)
Form1.ScaleHeight = Picture1.ScaleHeight + (2 * BorderSize)
Picture1.Move BorderSize, BorderSize

End Sub

------------------
Micah Carrick
Ordinary joe, only not named joe.
http://micah.carrick.com
micah@carrick.com
ICQ: 53480225