你可以Form
上放置一个PictureBox
,将Visible
属性设为False
,AutoSize
属性设为True
。将PictureBox
的Picture
属性设置为你需要的图片。然后在Form_Paint
事件中输入如下代码:
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