Forum Discussion
Jack_Viljoen
Feb 08, 2022Copper Contributor
When a Button is clicked hide a Label
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
- sedattumCopper Contributor
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.
- GenjiHatakataCopper Contributor
sedattum , I think #2 should be like this:
OnSelect -> Set(hideLabel, !hideLabel)
to flip the hideLabel variable