by Anonymous (267 Submissions)
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 color gradient to a form without any API calls. Also allows you to specify the beginning and ending RGB values.
StartGreen As Integer, StartBlue As Integer, _
EndRed As Integer, EndGreen As Integer, EndBlue As Integer)
On Error Resume Next
Dim X As Integer
Dim RedChange As Integer
Dim GreenChange As Integer
Dim BlueChange As Integer
frm.DrawStyle = 6 ' Inside Solid
frm.ScaleMode = 3 ' Pixels
frm.DrawMode = 13 ' Copy Pen
frm.DrawWidth = 2
frm.ScaleHeight = 256
For X = 0 To 255 'Start Loop
frm.Line (0, X)-(Screen.Width, X - 1), _
RGB(StartRed + RedChange, StartGreen + GreenChange, _
StartBlue + BlueChange), B 'Draws Line With correct color
RedChange = RedChange + (EndRed - StartRed) / 255 '
GreenChange = GreenChange + (EndGreen - StartGreen) / 255 ' Sets Next Loops Color
BlueChange = BlueChange + (EndBlue - StartBlue) / 255 '
Next X
End Sub
No comments have been posted about Add a color gradient to a form without any API calls. Also allows you to specify the beginning and . Why not be the first to post a comment about Add a color gradient to a form without any API calls. Also allows you to specify the beginning and .