Gradient forms from sides to middle

Category:
Screen/Graphics
Type:
Snippets
Difficulty:
Intermediate
Author:
Stephan Swertvaegher

Version Compatibility:

More information:
'Start a new project with a form: Form1
'Add a module. Put the BoxGradient-routine in the module.
'Be sure to set the autoredraw of the form to true.
'Instead of a form, you can also do it with a picturebox.
'Try this:

Private Sub Command1_Click()
Call BoxGradient(Form1, 255, 255, 255, 2, 1, 2, False)
End Sub

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: