Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

createEventObject method

Creates an event object that can be used to pass event context information to the PUBLIC:EVENT element's fire method.


var ppEventObject = element.createEventObject();


ppEventObject [out, retval]

Type: IHTMLEventObj

Returns an event object.

Return value

This method does not return a value.


The same event object cannot be reused in multiple calls to the fire method.

All properties of the event object that is created using IHTCDefaultDispatch::createEventObject are read/write, including those properties that would be read-only in Dynamic HTML (DHTML). You can use the HTML Component (HTC) file to set properties on the event object before firing an event.


This example is derived from a calculator behavior sample. When the result changes, the behavior fires a custom onResultChange event back to the page, passing the result as a custom property of the event object.

<public:event name="onResultChange" id="rcID" />

<script language="javascript">

function doCalc()
   oEvent = createEventObject();
   oEvent.result = sResult;
   rcID.fire (oEvent);

This example shows what the containing page looks like.

<html xmlns:InetSDK>
@media all {
   InetSDK\:CALC    {behavior:url(engine.htc)} 

<InetSDK:CALC id="myCalc"
<tr><div id="resultWindow" style="border: 0.025cm solid gray;" align="right">0.</div></tr>
<tr><td><input type="button" value=" 7 "></td>
    <td><input type="button" value=" 8 "></td>
    <td><input type="button" value=" 9 "></td>
    <td><input type="button" value=" / "></td>
    <td><input type="button" value=" C "></td>

Code example: http://samples.msdn.microsoft.com/workshop/samples/components/htc/calc/calc.htm

See also

Introduction to DHTML Behaviors
Introduction to Viewlink
About Element Behaviors



Community Additions

© 2015 Microsoft