BCX_SET_EDIT_COLOR function

Purpose: BCX_SET_EDIT_COLOR will set the colors in a BCX_Edit Control according to the values in the RGB foreground and RGB background arguments. BCX_SET_EDIT_COLOR *MUST* appear inside the EVENTS LOOP, otherwise it will not work and you will get a compile error.


Syntax 1:

 hBrush = BCX_SET_EDIT_COLOR(HandleToBCX_EditControl, _
                                         RGBforeground, _
                                         RGBbackground)

Syntax 2:

 hBrush = BCX_SET_EDIT_COLOR HandleToBCX_EditControl, _
                                         RGBforeground, _
                                         RGBbackground

 Parameters:

  • HBrush A handle to a logical brush is returned if the function succeeds. The return value is NULL if the function fails.
  • HandleToBCX_EditControl Handle to the BCX_EDIT control to be colored.
  • RGBforeground RGB(r,g,b) expression for foreground color of edit control.
  • RGBbackground RGB(r,g,b) expression for background color of edit control.

Also see QBCOLOR for an alternative to using the RGB(r,g,b) macro.

Example:


 BCX_SET_EDIT_COLOR Edit_1, RGB(64,128,128), RGB(225,225,225)

Result: The color in Edit_1 control will be set to the foreground and background RGB values.

Remarks: BCX_SET_EDIT_COLOR *MUST* appear inside the EVENTS LOOP, otherwise it will not work and you will get a compile error.

For examples of the BCX_SET_EDIT_COLOR function see FontDemo.bas and FontDialogDemo.bas  .