# Dynamic Properties

> Source: https://manual.pvxplus.com/nomads-graphical-application/program-interaction/event-handler-routines/dynamic-properties

Graphical user interface control objects have a variety of design attributes associated with them. The **[Apostrophe Operator](https://manual.pvxplus.com/appendix/apostrophe-operator)** (*tick*) allows ***dynamic*** access to the property names used to define these attributes for a given graphical user interface control. Any numeric variable containing the CTL number associated with a control can be used with the apostrophe operator. REFRESH_FLG, which forces the update of the panel controls, does not have to be set. This feature allows you to redesign a control object dynamically in your application by assigning or resetting its properties/attributes.

A button's location, size, text and colour would be represented by properties named **Col**, **Line**, **Text$**, **TextColour$**, etc.

***Example:***

You could change the text of a button control (called *MyButton*) as follows:

MyButton.ctl'Text $ = "Hit me now"

Other common property names include:

|  |  |  |
| --- | --- | --- |
|  | **['Col](https://manual.pvxplus.com/properties/col)** | Starting column |
|  | **['Line](https://manual.pvxplus.com/properties/line)** | Starting line |
|  | **['Cols](https://manual.pvxplus.com/properties/cols)** | Width of control |
|  | **['Lines](https://manual.pvxplus.com/properties/lines)** | Height of control |
|  | **['Tip$](https://manual.pvxplus.com/properties/tip)** | Tip message |
|  | **['Msg$](https://manual.pvxplus.com/properties/msg)** | Message line |
|  | **['Fmt$](https://manual.pvxplus.com/properties/fmt)** | Format mask |
|  | **['BackColor$](https://manual.pvxplus.com/properties/backcolor)** | Background color |
|  | **['Enabled](https://manual.pvxplus.com/properties/enabled)** | Enabled state |
|  | **['Lock](https://manual.pvxplus.com/properties/lock)** | Locked state |
|  | **['Value$](https://manual.pvxplus.com/properties/value)** | Current value/state of control |

To obtain a complete list of properties for a given control, read the logical attribute **\***:

```
PRINT BUTTON_1.CTL'*
```

This would result in a list of the attributes for the control BUTTON_1.

There is virtually no end to what can be changed on the fly within your controls. Most control commands can be changed by accessing attributes.

Warning!  
NOMADS stores the current value of a control in a variable with the same name as the control. If you change a control value using the ['Value$](https://manual.pvxplus.com/properties/value) property, you must also change the control's variable to keep NOMADS in sync.

The examples below illustrate some of the uses of dynamic properties.

NOMADS object CUST_NAME is defined as a multi-line 30 wide x 1 high:

```
->PRINT CUST_NAME.CTL'*
Auto,BackColour,Col,Cols,CtlName,Enabled,Eom,Fmt,Focus,Font,Height,hWnd,
Key,Left,Len,Line,Lines,Lock,Msg,Nul,OnFocusCtl,Parent,Sep,TextColour,Tip,Top,Value,Visible,Width,
->LET CUST_NAME.CTL'Tip$="This is a NEW Customer Name Tip"
```

The following shows how you can dynamically change properties of an object:

```
IF COUNTRY$="CDN" THEN ZIP.CTL'Fmt$="A0A 0A0" ELSE ZIP.CTL'Fmt$="00000"
```
