Add a rectangular gradient to a form.
Add a rectangular gradient to a form.
Rate Add a rectangular gradient to a form.
(2(2 Vote))
If frm.WindowState = vbMinimized Then Exit Sub
frm.BackColor = RGB(re, ge, be)
If smooth = True Then
frm.DrawStyle = 6
Else
frm.DrawStyle = 0
End If
If frm.ScaleWidth <> 255 Then
frm.ScaleWidth = 255
End If
If frm.ScaleHeight <> 255 Then
frm.ScaleHeight = 255
End If
frm.DrawWidth = 5
frm.Refresh
ri = (rs - re) / 255
gi = (gs - ge) / 255
bi = (bs - be) / 255
rc = rs: bc = bs: gc = gs
For X = 255 To 0 Step -1
DoEvents
frm.Line ((X / 2), (X / 2))-(frm.ScaleWidth - (X / 2), frm.ScaleHeight - (X / 2)), RGB(rc, gc, bc), B
rc = rc - ri
gc = gc - gi
bc = bc - bi
Next X
End Sub
'Sample for using this routine
Private Sub Form_Resize()
RectGradient Form1, 111, 111, 222, 222, 255, 255, True
End Sub
Add a rectangular gradient to a form. Comments
No comments yet — be the first to post one!
Post a Comment