The Event
control is used to manage events that can be
handled by TestComplete. This is an ActiveX control. It can be used either
in TestComplete or in any other external application. The unique feature of this control is
that you can modify the list of its events using the TestComplete Events project item.
See
Adding Events to Event Controls
and
Removing Events From Event Controls
for more information.
The Event
control includes the following methods:
Method | Description |
---|---|
AttachTo (Obj) |
Attaches the Event control to the Obj object. Obj must implement the IDispatch interface. After the Event control has been attached,
it can handle Obj events that are added to the control.
Note that if you are going to handle a COM application event that corresponds to a COM-server application (for instance, Microsoft Word or Outlook application), you should specify the application COM object rather than the TestComplete JavaScript var objOutlook; JScript var objOutlook; Python
VBScript Dim objOutlook DelphiScript var C++Script, C#Script var objOutlook; |
AttachToTestComplete |
Used by Connected Applications to attach to the given Event control. After attaching to TestComplete, you will be able to handle TestComplete events that are added to the given Event control (for the full list of TestComplete events, see TestComplete Events). |
DetachFrom (Obj) |
Detaches the Event control from the object Obj. Note that after the Event control has been detached, you will not be able to handle these events. |
DetachFromTestComplete |
Used by Connected Applications to detach the given Event control from TestComplete. Note that after detaching from TestComplete, you will not be able to handle TestComplete events added to the Event control. |
Note: | The Event control only contains the AttachToTestComplete and DetachFromTestComplete methods if you added TestComplete events to the control. |
See the following topics for more information on how to use these methods:
Creating Event Handlers for External COM Objects
Creating Event Handlers in Visual C++ Applications
Creating Event Handlers in C# Applications
Creating Event Handlers in Visual Basic Applications
Creating Event Handlers in Delphi and C++Builder Applications
See Also
Handling Events
Handling Events - Overview
TestComplete Events