# Button Control

> Source: https://manual.pvxplus.com/pxplus-user-guide/graphical-user-interfaces/control-objects/button

**BUTTON** \[ **\*** \] *ctl_id*, @(*col,ln,wth,ht*) = *contents$* \[, *ctrlopt* \]
**BUTTON** { **REMOVE** | **DISABLE** | **ENABLE** | **ON** | **OFF** } \[\*\] *ctl_id*
**BUTTON** { **HIDE** | **SHOW** | **GOTO** } \[ **\*** \] *ctl_id*  
**BUTTON SET_FOCUS** \[ **\*** \] *ctl_id, ctl_val*  
**BUTTON READ** \[ **\*** \] *ctl_id, mode$*

When a user clicks a button in a graphical application, it is usually defined to send a signal (*ctl_id*) to the application to perform a specific action. See **[CTL Values](https://manual.pvxplus.com/pxplus-user-guide/graphical-user-interfaces/introduction#ctlvalues)**.

Several options are available for creating a button control in PxPlus. For syntax details, see **[BUTTON](https://manual.pvxplus.com/directives/button)** directive.

Note:  
Other similar "button" behaviour may be defined using [Radio Button](https://manual.pvxplus.com/pxplus-user-guide/graphical-user-interfaces/control-objects/radio-buttons) or [Check Box and Tri-State](https://manual.pvxplus.com/pxplus-user-guide/graphical-user-interfaces/control-objects/check-box) controls.

For information on adding a button to a panel using the **[NOMADS Panel Designer](https://manual.pvxplus.com/nomads-graphical-application/panel-designer/introduction)**, see **[Button Control](https://manual.pvxplus.com/nomads-graphical-application/creating-panel-controls/button-control/overview)**.

The **[BUTTON](https://manual.pvxplus.com/directives/button)** directive can also be used to place a **[Taskbar Notification Icon](https://manual.pvxplus.com/pxplus-user-guide/graphical-user-interfaces/taskbar-notification-icon/overview)** in the bottom right corner of the MS Windows desktop (a.k.a. the *System Tray)*. See **[Handling Images and Icons](https://manual.pvxplus.com/pxplus-user-guide/appendix-of-miscellaneous-topics/handling-images-and-icons/overview)**.

For a list of properties that can be applied to a ***button***, see **[Button Properties](https://manual.pvxplus.com/control-object-properties/button-properties)**.

***Example:***

```
B1=1001;
BUTTON B1,@(5,18,10,2)="{!book_open}Library"
B2=1002;
BUTTON B2,@(20,18,10,2)="Library"
B2'TEXTCOLOUR$="Green"
B3=1003;
BUTTON B3,@(35,18,10,2)="Library",OPT="VUTf";
B3'HOVERCOLOUR$="Red"
INPUT "Press any key to end ",*,'CS',
```

This example creates three buttons with control IDs of 1001 to 1003, 10 columns wide and 2 lines high.

![](https://manual.pvxplus.com/migration-assets/de91821488eb23dff756ce53424ec3367796162f94fb21659869853335ff4acc.jpg)

The first button contains a bitmap of an open book and the text "Library". The PxPlus installation includes a group of internal bitmaps available for use in control objects identified by a leading **!** *exclamation point* in the syntax. Braces indicate that the bitmap is to be placed on the button. See **[Displaying Bitmaps/Icons](https://manual.pvxplus.com/appendix/displaying-bitmaps-icons)**.

The second button is specified with text colour set to "Green" using a dynamic property. For the third button, the "VUTf" options are applied to make it transparent and flat with no border. It also has underlined text that changes colour to "Red" when the mouse hovers over it.
