SetLayer

How to:

The SetLayer command allows layers to be set as visible or invisible at run time. It can be used in a Maintain or a JavaScript event.


Top of page

x
Syntax: How to Use the SetLayer Command

The syntax of the SetLayer command is

Maintain

Formname.SetLayer.(“layername“,n);

JavaScript

setLayer.formname.(“layername“,n);

Note: JavaScript is case-sensitive.

where:

“layername“

Is the name of the layer, enclosed in double quotation marks.

n

Possible values are:

  • 0 sets the layer to invisible (off).
  • 1 sets the layer to visible (on).

To preset a layer before the form is run, you can use the SetLayer command with the Winform Show_inactive command:

Winform Show_inactive Form1;
Form1.SetLayer(“Layer1“,1);
Form1.SetLayer(“Layer2“,0);
Winform Show Form1;

This sets Layer1 as visible and Layer2 as invisible.


WebFOCUS