BCX_SET_FORM_COLOR statement
Purpose: BCX_SET_FORM_COLOR will color a Control according to the value in RGBFormColor.
Syntax 1:
BCX_SET_FORM_COLOR hWnd,RGBFormColor
Syntax 2:
BCX_SET_FORM_COLOR(hWnd,RGBFormColor) Parameters:
|
Example:
BCX_SET_FORM_COLOR FORM1, RGB(0,0,0)
Result: FORM1 will be black
Example:
BCX_SET_FORM_COLOR FORM1, RGB(255,255,255)
Result: FORM1 will be white
For an example of the BCX_SET_FORM_COLOR statement see FontDemo.bas.
Notes: Normally, you only need to issue this command once, so it is best to issue it in SUB FORMLOAD before calling SHOW(YourForm).
BCX_SET_FORM_COLOR forces Windows to redraw your Form each time that you use command is executed. This can lead to severe flicker and other undesirable effects.
NEVER use this command directly in the BEGIN EVENTS loop.
For example: Never do this!
BEGIN EVENTS BCX_SET_FORM_COLOR(Form1, RGB(128,128,128),(64,64,64)) END EVENTS
Instead, tie the command to a particular event, like this:
BEGIN EVENTS SELECT CASE WM_COMMAND CASE ID_I_WANT_TO_CHANGE_THE_COLORS_NOW BCX_SET_FORM_COLOR(Form1, RGB(128,128,128),(64,64,64)) END SELECT END EVENTS
QBCOLOR statement
Purpose: QBCOLOR returns a Long representing the RGB color code corresponding to the specified color number.
Syntax: QBCOLOR(TheColor%) Parameters:
|
Example:
BCX_SET_FORM_COLOR(Form1, QBCOLOR(6)) ' set form to brown