|
|
Title | Tile a form with an image |
Keywords | form, tile, background |
Categories | Tips and Tricks, Graphics |
|
|
In the Form_Paint event handler, use PaintPicture to copy the image in a PictureBox onto the form repeatedly until the form is full.
|
|
Private Sub Form_Paint()
Dim wid As Single
Dim hgt As Single
Dim x As Single
Dim y As Single
wid = Picture1.ScaleWidth
hgt = Picture1.ScaleHeight
y = 0
Do While y < ScaleHeight
x = 0
Do While x < ScaleWidth
PaintPicture Picture1.Picture, _
x, y, wid, hgt
x = x + wid
Loop
y = y + hgt
Loop
End Sub
|
|
|
|
|
|