你可以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
博客展示了一段VB代码,在Form_Paint事件中,通过嵌套循环实现图片在窗体上的重复绘制。代码先获取图片的宽度和高度,然后在窗体范围内不断绘制图片,直至覆盖整个窗体。
1万+

被折叠的 条评论
为什么被折叠?



