Returns a single color value from a set of red, green, and blue color components.
RGB(nRedValue, nGreenValue, nBlueValue)
- Specifies the intensity of the red color component. nRedValue can range from 0 to 255. Zero is the minimum color intensity; 255 is the maximum color intensity.
- Specifies the intensity of the green color component. nGreenValue can range from 0 to 255.
- Specifies the intensity of the blue color component. nBlueValue can range from 0 to 255.
The value returned by RGB(В ) can be used to set color properties such as BackColor and ForeColor.
The following example uses RGB(В ) to change the background color of a Form to blue.
goMyForm = CREATEOBJECT('FORM') && Create a form goMyForm.Show && Display the form WAIT WINDOW 'Press a key to change the form color' goMyForm.BackColor=RGB(0,0,255) && Change the form background color WAIT WINDOW 'Press a key to release the form' RELEASE goMyForm && Release the form from memory