When a Button is clicked hide a Label

Copper Contributor

Hi all,

 

I am trying to make it so when a button is clicked, a label below it with some text in it hides, when I click it again it re-appears.

 

Any help is appreciated. Thanks

2 Replies

Hi,

 

  • On your app, click on App and select OnStart and then create a variable as hideLabel and set it to true

 

Set(hideLabel, true)

 

  • OnSelect function of your button create a variable and set it an if statement.

 

If(hideLabel, false, true)

 

And on your label's Visible function remove true and set it to hideLabel variable. So each time when you click on your button if hideLabel is true it will set it to false and hide your label, if it is false it will set it to true and display your label.

 

Hope this helps. 

@Jack_Viljoen 

@sedattum , I think #2 should be like this:

 OnSelect -> Set(hideLabel, !hideLabel)

to flip the hideLabel variable