# Re: 请问如何把图片填满form成为背景图?

Posted by 纪文和 on July 20, 1999 at 01:41:09:

In Reply to: 请问如何把图片填满form成为背景图? posted by mikasa on July 20, 1999 at 00:29:39:

: 我在书上看过好像有属性可直接套用的,
: 可是它是用中文解说的,我找不到说:~~
: 烦请知道的前辈跟小弟说一下,谢谢:)

对于这个问题, 我看过很多方法, 但没有看过您说的方式, 有的方法很麻烦, 要宣告一大堆 TYPE, 用一大堆旳API, 但是有一个最笨但我认为最好的方法如下:
(不用任何 API, 不必宣告任何 Type)

Sub PictureTile(Frm As Form, Pic As PictureBox)
Dim i As Integer
Dim t As Integer
Frm.AutoRedraw = True
Pic.BorderStyle = 0
For t = 0 To Frm.Height Step Pic.ScaleHeight
For i = 0 To Frm.Width Step Pic.ScaleWidth
Frm.PaintPicture Pic.Picture, i, t
Next i
Next t
End Sub

原作者是 Hound_Dog

Follow Ups: