SetControlBackColour
Definition:
SetControlBackColour(control, red, green, blue)
Description:
Set the background colour for a control.
Platforms:
All
Parameters:
control - required
Name of the control whose background colour you want to change.
red - required
Value of the red component of the required background colour.
Must be an integer in the range: 0 – 255.
green - required
Value of the green component of the required background colour.
Must be an integer in the range: 0 – 255.
blue - required
Value of the blue component of the required background colour.
Must be an integer in the range: 0 – 255.
Returns:
nothing
Notes:
The effect of changing the background colour varies depending upon the type of control and the Target Platform:
-
On Android Devices, by default, you can use this Method to change the background colour for a Button, Date Picker, HTML Text or Static Text Control.
You can also extend the use of this Method to change the background colour of Edit Controls or Combo Boxes (both types) as well, but in order to affect these controls, you will need to edit the Script assigned to the Application level OnLoad Event first.
Click here to display instructions on how to enable background colour changing for Edit Controls and Combo Boxes on Android devices-
In App Studio click on the top node in the Forms, Data Sources or Resources Panes to display the Application Properties in the Properties Pane.
-
Under the Events category, find the OnLoad Event and double-click on it to open the Application Script window in the Workspace.
-
The Script window will display the current contents of the OnLoad Script. If the Script hasn't previously been edited, the window will look like this:
If this Script has been edited previously, you will see the Script code displayed between the Function OnLoad and End Function lines.
-
To enable Edit Controls and Combo Boxes to have their background colours changed as well, you need to insert the following line immediately after the Function OnLoad line:
' #ENABLE ANDROID_FULL_BACKGROUND_COLOURS
If the Script hasn't otherwise been edited, it will now look like this:
-
You can now use SetControlBackColour to change the background colour of Edit Controls and Combo Boxes in any Script in this Project.
-
Remember to save your Project before you close it.
-
-
On iOS devices you can change the background colour for all controls.
-
On the Windows Universal Platform, you can change the background colour for all controls except Progress and Slider Controls.
-
On the Windows Desktop Platform you can change the background colour for all controls except Slider Controls.