Create multi-colored forms without using the API
By: Unknown Date: 24/09/1998


674 bytes

Download now!

Although using the API is a nice way to create multi-colored forms, there might be a reason why you would wish to create one without using the API.


PaintForm form, orientation, RStart, GStart, BStart, RInc, GInc, BInc


form: name of the form to paint
orientation: top to bottom (0) or right to left (1) style of painting
RStart: starting ammount of red (0-255)
GStart: starting ammount of green (0-255)
BStart: starting ammount of blue (0-255)
RInc: ammount to increment or decrement for red (0-255)
GInc: ammount to increment or decrement for green (0-255)
BInc: ammount to increment or decrement for blue (0-255)

Type of data



A string containing only the numeric value


To paint a form call the PaintForm procedure as follows:

PaintForm Me, 1, 100, 0, 255, 1, 0, -1

Experiment with the parameters and see what you can come up with. Keep the values for the incrementing low so as to create a smooth transition, whether they are negative or positive numbers.

The function is contained in a module. You can cut and paste it in any program of yours.

Click Here!

Visual Basic Programming Zone is a website by Lorenzo Dalla Vecchia.
Webmaster's e-mail:
Hosted by InWind: