VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Add a spin gradient to a form.

by DiP's VB World ()
Category: Custom Controls/Forms/Menus
Compatability: Visual Basic 4.0 (32-bit)
Difficulty: Unknown Difficulty
Originally Published: Sat 13th March 1999
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Add a spin gradient to a form.

Rate Add a spin gradient to a form.




If frm.WindowState = vbMinimized Then Exit Sub
frm.BackColor = RGB(rs, gs, bs)
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 / 2
gi = (gs - ge) / 255 / 2
bi = (bs - be) / 255 / 2
rc = rs: bc = bs: gc = gs
For X = 0 To 255
    DoEvents
    frm.Line (X, 0)-(255 - X, 255), RGB(rc, gc, bc)
    rc = rc - ri
    gc = gc - gi
    bc = bc - bi
Next X
For X = 0 To 255
    DoEvents
    frm.Line (255, X)-(0, 255 - X), RGB(rc, gc, bc)
    rc = rc - ri
    gc = gc - gi
    bc = bc - bi
Next X
End Sub
'Sample for using this routine
Private Sub Form_Resize()
    SpinGradient Form1, 111, 111, 222, 222, 255, 255, True
End Sub

Download this snippet    Add to My Saved Code

Add a spin gradient to a form. Comments

No comments have been posted about Add a spin gradient to a form.. Why not be the first to post a comment about Add a spin gradient to a form..

Post your comment

Subject:
Message:
0/1000 characters