Syntax: %btncol(number|id,color1,color2)

Changes and returns the color of a button. The button can be identified with the button number or button id. If the colors are not specified, the current button color (background) attribute is returned.

If only one color is specified, then color1 gives the background color of the button. If both colors are specified, then color1 is the text color and color2 is the background color.

You can also use %btncol to change the color of a gauge.


#BUTTON 1 "Test button" {button clicked}
#CALL %btncol(1,blue,green)
Set the button color to blue text on green background.

#SHOW %btncol(1)
Displays the numeric button color.

newcol = %color(green)+%color(hi)+%color(0,blue)
#CALL %btncol(1,@newcol)
Sets the color directly with a numeric color value. In this case, we add a text color of green, plus a highlight value, plus a blue background color together.

Add comment

Login or register to post comments