by Wayne Alec de Bruin (6 Submissions)
Category: Graphics
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Sat 14th September 2002
Date Added: Mon 8th February 2021
Rating: (1 Votes)
Draw color gradient to picture box form or...
'
' Colour fade form.
On Error Resume Next
'
Dim intLoop As Integer 'Variable for loop
'
' Picture box AutoRedrdraw property must be " _
set to True.
With Picture1
.DrawStyle = vbInsideSolid 'Set Form Modes
.DrawMode = vbCopyPen
.ScaleMode = vbPixels
.DrawWidth = 2
.ScaleHeight = 256
For intLoop = 0 To 255 'Begin Loop
'The RBG numbers can be changed to draw different colors
Picture1.Line (0, intLoop)-(Screen.Width, intLoop - 1), RGB(150, 250, 350 - intLoop), B 'Draw boxes with specified color of loop
Next intLoop
End With
'
End Sub