After all those posts discussing and showing how to create gradient backgrounds for VFP forms, I decided to create a simple but powerful class to ease this process.
The GRADBACKGROUNDS class is stored inside the GRADIENTOBJECTS.VCX, the class that I published last year that converts any CommandButton, Graphical CheckBox or Graphical OptionBox.
Just drop an instance of the class GradBackgrounds to any Form, Container or Pageframe and set some properties to obtain the gradient effects shown below.
All the Background images are created using GDI+, but with no helper class, because I wanted to obtain the best performance possible.
Properties

GradientMode - Numeric, from 1 to 4, determines the gradient type to be created
1 - Horizontal 2 - Vertical 3 - diagonal 1 4 - diagonal 2 using linear gradient brushes with 2 colors
BackColor1 - Numeric, the RGB value of the starting color of the gradient background
BackColor2 - Numeric, the RGB value of the destination color of the gradient background
ReduceColorLevel - Numeric, automatically sets the destination color of the gradient (backColor2) ranging from 0 (no change) to 100 (white). If left to .F., then no change is applied and the original values of BackColor2 and SelBackColor2 will be used.
UpdateTabColor - In the case of a PageFrame, sets "themes" off to allow the tab background to be in the same color of the gradient
Method
Update - Updates the gradient if you change any of the above properties
Form using GradientMode = 1

Form using GradientMode = 2

Form using GradientMode = 3
Form using GradientMode = 4
PLAYING WITH PAGEFRAMES
As containers, PageFrames allow to set a Picture property. We can also obtain a cool effect changing the Tab colors to use the same color of the gradient picture.
To make it work, drop an instance of the class inside EVERY page thet you want to convert to Gradient. When inside a pageframe, the property gradient mode becomes automatic, and works according to the TabOrientation property of the PageFrame.

The gradient adapts to the tabOrientation property of the PageFrame


IMPORTANT NOTES
To make the class work inside a container, don't forget to set its backStyle to 1 - Opaque
DOnt forget to set the BackStyle property of your labels to 0 - Transparent
VFP9 IS COOL !
In this version of the class I started using some scripts to ease the manipulation of the properties. For example, now if you double click on the BackColor1 Property, the color picker opens automatically, to allow you to choose your color. Thanks to the great book "What's new in Nine", and some great tips from Fabio Lunardon and Tamar Granor.
DISCLAIMER
This class is totally free. The information provided on this page and the source code related to this article comes without any warranty whatsoever. Use it at your own risk.
SOME RELATED LINKS
Gradient Backgrounds in your forms with GDI+
Gradient Command Buttons with GDI+
GRADIENT OBJECTS WITH GDI+ REVISITED
As always, if you have any suggestion, or find any bugs please tell me !
Click here to download the latest version of the Gradient objects class.