' Fill the form with an elliptical gradient.
Private Sub ShadeForm()
Const COLOR_OUTER = 64
Const COLOR_INNER = 255
Dim cx As Single
Dim cy As Single
Dim r As Single
Dim i As Single
Dim clr As Single
Dim dclr As Single
Cls
ScaleMode = vbPixels
cx = ScaleWidth / 2
cy = ScaleHeight / 2
BackColor = RGB(0, 0, COLOR_OUTER)
If cx > cy Then
r = cx
Else
r = cy
End If
FillStyle = vbFSSolid
DrawStyle = vbTransparent
dclr = (COLOR_INNER - COLOR_OUTER) / r
clr = COLOR_OUTER
For i = r To 1 Step -1
FillColor = RGB(0, 0, clr)
ForeColor = RGB(0, 0, clr)
clr = clr + dclr
Circle (cx, cy), i, , , , cy / cx
Next i
End Sub
|