Click to See Complete Forum and Search --> : Form Background picture


mosman
February 26th, 2000, 10:39 AM
Hi all,
I am trying to create a form that has a background image (texure),but I don't want to use the picture or the image controls (they a lot of time when loading the form). I did try to use the picture property of the Form, but my problem is that I want the texure to cover the whole background of the form; even when I resize it. Is there a way to do that, I am can I tile a small picture to cover the form; I don't want to strech it, because the image looks very bad when the I maximize the form.
thank in advance

February 26th, 2000, 12:26 PM
well, if you dont want the person to resize the form do this:
'be sure to disable the maximize feature
'set the timers interval to 1

If Form1.Height > 2775 Then
Form1.Height = 2775
End If
If Form1.Width > 5550 Then
Form1.Width = 5550
End If

Johnny101
February 26th, 2000, 03:51 PM
I use this code to paint a picture across the form. I have one picture box on the form, but i'm not tiling that control, just the contents of it.

private Sub Form_Load()

With Picture1
.AutoSize = true
.BorderStyle = 0
.Visible = false
End With

End Sub

private Sub Form_Paint()
Dim i as Long, j as Long

With Picture1
for i = 0 to me.ScaleWidth step .Width
for j = 0 to me.ScaleHeight step .Height
me.PaintPicture .Picture, i, j
next j
next i
End With

End Sub

private Sub Form_Resize()
me.Refresh
End Sub




This works, and works fast too. It handles maximizing and resizing without a problem.

Hope this helps,
John

John Pirkey
MCSD
www.ShallowWaterSystems.com