用下面的代码试试: Private Sub BackGround(f As Form, pic As PictureBox) For i = 0 To (f.ScaleWidth \ pic.Width) For j = 0 To (f.ScaleHeight \ pic.Height) PaintPicture pic.Picture, i * pic.Width, j * pic.Height Next Next '将pic中的图片铺满整个窗口作为窗口背景花纹 End SubPrivate Sub Form_Load() Me.AutoRedraw = True '窗口可以自动重画 Pic1.Visible = False '隐藏 Pic1.BorderStyle = 0 '没有边框 Pic1.AutoSize = True '根据载入的图片自动调节大小 Pic1.Picture = LoadPicture(App.Path + "\2.bmp") '载入图片 'App指本程序 'App.Path指本程序路径 '文件3.bmp存储在本程序目录中 BackGround Me, Pic1 '调用子过程BackGround将Pic1中的图片充满窗口 End Sub Private Sub Form_Resize() BackGround Me, Pic1 End Sub
Private Sub BackGround(f As Form, pic As PictureBox)
For i = 0 To (f.ScaleWidth \ pic.Width)
For j = 0 To (f.ScaleHeight \ pic.Height)
PaintPicture pic.Picture, i * pic.Width, j * pic.Height
Next
Next
'将pic中的图片铺满整个窗口作为窗口背景花纹
End SubPrivate Sub Form_Load()
Me.AutoRedraw = True
'窗口可以自动重画
Pic1.Visible = False
'隐藏
Pic1.BorderStyle = 0
'没有边框
Pic1.AutoSize = True
'根据载入的图片自动调节大小
Pic1.Picture = LoadPicture(App.Path + "\2.bmp")
'载入图片
'App指本程序
'App.Path指本程序路径
'文件3.bmp存储在本程序目录中
BackGround Me, Pic1
'调用子过程BackGround将Pic1中的图片充满窗口
End Sub
Private Sub Form_Resize()
BackGround Me, Pic1
End Sub