Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
C# Helper...
 
XML RSS Feed
Follow VBHelper on Twitter
 
 
MSDN Visual Basic Community
 
 
 
 
 
 
TitleTile a form with an image
Keywordsform, tile, background
CategoriesTips 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
 
 
Copyright © 1997-2010 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated