User Tools

Site Tools


Sidebar

Privacy Policy

News

Version 2.50 is out since Jan 1st 2022


Frequently Asked Questions


Namespaces

Note for contributors

If you wish to create a new page in the DroidScript wiki, please click on the most appropriate namespace above and follow the notes for contributors there.

Because of spam, it has been necessary to add a CAPTCHA to the registration form and the save option for editing pages. You will not need to prove you are human if you are logged in, so please register.

Please feel free to improve any existing page, as well as adding new pages to increase the sum of public knowledge about DroidScript.

Formatting Syntax

tips_tricks:toggle_visibility

Toggle Visibility

Do you want a button to hide a layout or control, then the next time to show it again?

Call this function.

togglevis.js
function toggleVisibility(control,gone)
//param1 is a control or layout
//param2 true=Gone,false=Hide (default false)
{
   if(control.GetVisibility()=="Show")
   {
       control.SetVisibility(gone?"Gone":"Hide")
   }
   else
   {
       control.SetVisibility("Show")
   }
}

Note

If you pass true as the second parameter, when the control is hidden, it will be set to Gone.
If the second parameter is missing or false the visibility mode will be Hide

tips_tricks/toggle_visibility.txt · Last modified: 2015/04/06 16:46 (external edit)