Previous/Next Screen Switching Buttons

<< Click to Display Table of Contents >>

Manual > Screen Creation Guide > Script > Script Example > Script Tips >

Previous/Next Screen Switching Buttons

Previous/Next Screen Switching Buttons

When designing screen transitions for monitoring screens, a function for switching the display to the previous/next screen is often required. FA-Panel provides the methods "OpenPrevForm" and "OpenNextForm" for switching the previous/next screen display, making this function easy to implement.

 

Here we will introduce a script for switching screens using two buttons, the previous screen button and the next screen button.

 

•Switching between previous and next screens from a script
 
(Previous screen button)

event OnInitialize()

{

this.Enabled = ::IsHavePrevForm(); // Disable the button if there is no previous form

}

 

event OnMouseUp(button)

{

::OpenPrevForm(); // Display previous screen

}

 
(Next screen button)

event OnInitialize()

{

this.Enabled = ::IsHaveNextForm(); // Disable the button if there is no next screen

}

 

event OnMouseUp(button)

{

     ::OpenNextForm(); //Display next screen

}