# Binding Visibility To Tags

The standard way to control visibility of Page elements is to create tags and use the Visible property of the elements.

Note: Dynamically creating controls is not supported.

For example, on a Page, there is a Toggle Visibility button and a collection of elements that have been constructed to create a dial, which is used to adjust a value. The dial should disappear when the button is clicked.

1. Create a button and an HMI element that you want to hide.

2. In Tag Manager, create a tag called tg_Hidden. It should be Boolean type, True by default (in this example Truemakes the element visible).

3. Select your HMI element and bind its Visible property to tg_Hidden.

   1. Click the grey dot next to Visible.

   2. In the Expression Builder, bind the property to $tg_Hidden and then click OK.

   3. The green dot marks that Visible property is now bound to tg_Hidden.

4. Right-click your button and select On Mouse Click.

5. In the Button.OnClick script, enter the following: $tg_Hidden = !$tg_Hidden;

6. To test that it works, put your project in Test Mode, and press the button.