Before we go too far, lest I forget, double-clicking a shape to control its visibility, is somewhat problematical. Hiding it not a big deal, but restoring it can be a problem, like, where is that shape???
That's the reason for the button, it's an independent shape. The shape could be setup to toggle a specific layer or layers. Thus you could use multiple buttons if so desired, each for a specific configuration. Or, use the right click menu and select what to show, not show.
First, assign shape to layer: just select shape, right click > format > layers. Create a layer name, and assign the shape to it. If layer already exists, just select desired layer (or layers).
To change a cell value in the shapesheet from some other cell, use the setf(getref(cellTochange),newValue). Place the formula in the "controlling" cell. To toggle the value, instead of newValue, use NOT(oldValue), i.e., setf(getref(cellTochange),not(oldValue)).
Since layers belong to the page they're on, the formula looks like: setf(getref(ThePage!Layers.Visible[1]),NOT(ThePage!Layers.Visible[1])).
To do multiple layers, use the "+" to catenate formulas, e.g., setf(layer[1] formula) + setf(layer[2] formula)
Alternatively, you can use the "actions" right click context menu and select the desired action.
If you open shapesheet of the button, you will see the Action section items. Same thing as the double click only now, you can pick a specific layer(s) to show hide. That involves the conditional "IF" formulas which establish the hide/don't hide conditions for each layer.
HTH
Wapperdude