Calling Methods at Runtime SECTION 5 ActiveX Objects
77
5-5 Calling Methods at Runtime
ActiveX methods can also be called at runtime. This is achieved by using the
Supervisor script function Execute or alternatively in VBScript using the
normal dot syntax for example
@VBSCRIPT
CommonDialog1.ShowOpen
@ENDIF
For more details see the CX-Supervisor Script Language Reference Manual.
5-6 Responding to Events
Some ActiveX components are written to generate events on certain
conditions, like mouse clicking or user input or error conditions. You can write
a script to execute whenever any event occurs. These scripts are defined as
subroutines in the page initialisation script as they may be called any time the
page is open. To easily add these subroutines, from the ActiveX property
browser, click the 'Events' tab. This shows all the event types for this control
and any parameters the event may pass, for example the code number of the
key pressed. Select the event name to add or edit the script for, and click the
square edit button.
Note: In previous versions Event scripts could be added from the Animation Editor
but the method above provides more efficiency as all event scripts are loaded
just once on page initialisation.