ChangeForm: Difference between revisions
Jump to navigation
Jump to search
C185driver (talk | contribs) |
|||
Line 11: | Line 11: | ||
ChangeForm(Form2) | ChangeForm(Form2) | ||
Function Form1_onhide() | Function Form1_onhide() |
Revision as of 10:35, 9 December 2014
ChangeForm(newForm)
Description
ChangeForm hides the current form and shows newForm. When the current form is hidden, its onhide() function is called. When the new form shows, its onshow() function is called. The global variable NSBCurrentForm is set to newForm.
Example (Basic)
Rem ChangeForm sample call ChangeForm(Form2) Function Form1_onhide() MsgBox "Old Form Hidden" End Function Function Form2_onshow() Msgbox "Show form " & NSBCurrentForm.id End Function
Use a variable to change forms:
ChangeForm(window["Form" & i])
Example (JavaScript)
//ChangeForm sample call ChangeForm(Form2); //go to next form without transition Form1.onhide = function() { alert("Old Form Hidden"); } Form2.onshow = function() { alert("Show form " + NSBCurrentForm.id); }
Output
(msgbox showing "Old Form Hidden")
(msgbox showing "Show form Form2")