Index
The Checkbox and how to create it
The Parameters
Checkbox Functions
Important Info

The Checkbox and how to create it

The Checkbox inherits from the control class. It is one of the many ways for an application to input information to the application. A Checkbox is
common in GUI applications as a way to input information that has two or more options, like the Radio Button, but you can select more than one
option at a time.

--Checkbox:
f1 = form(10, 10, 100, 100, false, "Main", color.white, color.AirForceBlue, true, false, false, false, false, false, true)
chk1 = checkbox(1, 1, "First Checkbox", true, color.buttondark, color.green, color.black, f1)
chk2 = checkbox(1, 10, "Second Checkbox", true, color.buttondark, color.green, color.black, f1)

The code is exactly how you would create a Checkbox. You must have a form created in order to store your Checkbox, as with any other derivative of
the control class. As always you can declare any class two ways and if you dont remember how, read the forms reference here: Forms
The image below shows what the Checkbox declared above looks like.

Figure 11:

Checkbox Image

The Checkbox parameters are as follows:

Parameter Description
int x The x location of the checkbox on the screen.
int y The y location of the checkbox on the screen.
string text Sets the checkboxes text to the string that was entered.
bool checked Sets the checkboxes selected property to either True or False,
determins weather they are checked or not.
color backcolor Sets the checkbox's outer rectangle color.
color checkcolor Sets the checkbox's inner rectangle color.
color textcolor Sets the checkbox's text color.
form parent The form that the checkbox will be visible on.

If you dont know the keywords, go here: Forms

Checkbox Functions

Here are the diffrent functions that you can call that do something with Checkboxes:

Function Description Call example
none none none

Important Info

If you have two or more checkboxes and you want one on top of another, I
suggest that you set the y value to this (prev_checkbox_y + 9).