|
用VB做渐变的窗体背景
Sub Dither(vForm As Form)
Dim intLoop As Integer
vForm.DrawStyle = vbInsideSolid
vForm.DrawMode = vbCopyPen
vForm.ScaleMode = vbPixels
vForm.DrawWidth = 2
vForm.ScaleHeight = 256
For intLoop = 0 To 255
vForm.Line (0, intLoop)-(Screen.Width, intLoop - 1), RGB(0, 0, 255 - intLoop), B
Next intLoop
End Sub
www.diannao114.cn
Private Sub Form_Activate()
Dither Me
End Sub
将窗体的AutoRedraw属性设为True.
如果想得到由红到黑的渐变,只需如下改动:
vForm.Line (0, intLoop)-(Screen.Width, intLoop - 1), RGB(255 - intLoop, 0, 0), B
以下是由绿到黑的渐变效果
vForm.Line (0, intLoop)-(Screen.Width, intLoop - 1), RGB(0,255 - intLoop, 0), B
用VB做渐变的窗体背景 |
|