What are properties?

<< Click to Display Table of Contents >>

Manual > Screen Creation Guide > Script > What are objects >

What are properties?

Scripts and Properties

The properties of each control can be referenced and their values edited from script. In the following example, the FillColor property of Button control itself is changed from a script written in the OnMouseUp event of Button control (FillColor is one of the properties of Button control and refers to the background color).

event OnMouseUp(button)
{
	this.FillColor = "#FF0000";
}

 

When you run it in Panel Browser and press the button, the button itself will change to red.

 

In this way, the property value can be changed dynamically from the script. The format for accessing properties is as follows (separated by periods).

 

[ObjectPath].[Property name]

 

example)

 

this.FillColor

parent.Label.Text

::Form01.Title

 

The property types are classified as follows:

 

type

Commentary

Example script

Boolean

This is a Boolean (TRUE or FALSE) property.

this.Border = T;

Number

A numeric property.

this.Width = 100;

character

It is a character property.

this.Text = "hello";

color

Color property. RGB is specified as the string "#RRGGBB". RR is a hexadecimal number from 00 to FF that indicates the degree of red. Similarly, GG indicates the degree of green, and BB indicates the degree of blue.

Also, colors registered as color themes are expressed as "@format name".

this.FillColor = "#FF0000";

this.FillColor = "@ButtonColor";

 

font

Font properties.

(Varies depending on font)

File Path

The path to the file.

this.File = "c:\abc.jpg";

Enumeration

An enumerated value is a property that has several options to choose from. For example, the FillStyle property of a rectangle control in a 2D Shape control can be selected from SOLID, HORIZONTAL, VERTICAL..., which is an enumerated property.

this.FillStyle = "SOLID";

 

 

hint

Each control has its own unique properties. For details about the properties of each control, please refer to the page for each control in "Control Reference".