[分享]颜色渐变窗体的实现
Option Explicit
Private Sub Form_Paint()
On Error GoTo err11
Dim lY As Long
Dim lScaleHeight As Long
Dim lScaleWidth As Long
ScaleMode = vbPixels
lScaleHeight = ScaleHeight
lScaleWidth = ScaleWidth
DrawStyle = vbInvisible
FillStyle = vbFSSolid
For lY = 0 To lScaleHeight
FillColor = RGB(0, 0, 255 - (lY * 255) \ lScaleHeight)
Line (-1, lY - 1)-(lScaleWidth, lY + 1), , B
Next lY
err11:
If Err.Number = 11 Then
Exit Sub
End If
End Sub