画一个跟窗体一样大的图像框image控件,把图片放在里面就可以利用image控件自动调整图片大小以适应图像框的功能来满足你的要求了。
窗体上画一个image控件,用如下代码:
Private Sub Form_Load()
Image1.Stretch = True
Image1.Left = 0
Image1.Top = 0
Image1.Width = Me.Width
Image1.Height = Me.Height
Image1.Picture = LoadPicture("c:\111.jpg")
End Sub
Private Sub Form_Resize()
Image1.Width = Me.Width
Image1.Height = Me.Height
End Sub
Image1.Top = 0
Image1.Left = 0
Image1.Height = Me.Height
Image1.Width = Me.Width
用picutrebox载入图片做背景