event Property

MS Office DHTML, HTML & CSS

event Property


Provides state information about a standard DHTML event passed from the scriptlet.

Applies To

Scriptlet object container

Syntax

value = ScriptContainer.event.member

Remarks

This property is read-only. The event property provides a way to get state information about any of the standard events passed from the scriptlet: onclick, ondblclick, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseup. This property corresponds to the DHTML event object.

To get state information, you can query the values of the event property's members, which include altKey, ctrlKey, keyCode, offsetX, offsetY, shiftKey, srcElement, type, and others. The following example script illustrates how you can use the event property to get more information about a standard event:

Sub ScriptContainer1_onkeyup()
   MsgBox "The character typed was " & ScriptContainer1.event.keyCode
   MsgBox "The Alt key state was " & ScriptContainer1.event.altKey
   MsgBox "The Ctrl key state was " & ScriptContainer1.event.ctrlKey
   MsgBox "The Shift key state was " & ScriptContainer1.event.shiftKey
   MsgBox "The mouse was at " & offsetX & ", " & offsetY
   MsgBox "The affected control was " & ScriptContainer1.event.srcElement
   MsgBox "The event was " & ScriptContainer1.event.type
End Sub

For more information about using the event property, refer to the event object in the DHTML documentation.


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? write us!Internet Link

© 1999 microsoft corporation. all rights reserved. terms of useInternet Link.