PDA

Click to See Complete Forum and Search --> : forms background picture.


Insane Killa
Jan 1st, 2000, 10:04 AM
does anyone have a code that will resize the forms background picture to the size of the form automatically no matter what size the form is?

XxEvilxX
Jan 1st, 2000, 02:37 PM
try this you need a picture box

Picturebox autosize = true
picturebox visible = false

form1.picture = loadpicture(picture1.picture)
form1.width = picture1.width
form1.height = picture1.height

mhayenga
Jan 2nd, 2000, 12:14 AM
You could work around this problem. Instead of trying to resize the picture property of the form you could simply add an image as the first control on your form and resize it as the form is resized....Here's how I'd do it....
1. Start a new project.
2. Add an Image to the form.
3. Set the TOP and LEFT properties to "0". Also change the stretch property to "True".
4.Finally add this code to the Form_Resize()

Private Sub Form_Resize()
Image1.Width = Form1.Width
Image1.Height = Form1.Height
End Sub

That should do it... Also you could change the background property of the form to a color close to the color of the background image (this reduces some static during resize). I know this is a cheap way to do it (and there are probably better ways), but it's only my second week of VB.

Mitchell Hayenga
mitch@hayenga.com