Class HtmlEventArgs
Provides event details to event handlers.
Inheritance
Inherited Members
Namespace: System.Windows.Browser
Assembly: OpenSilver.Browser.dll
Syntax
[NotImplemented]
public class HtmlEventArgs : EventArgs
Properties
| Improve this Doc View SourceAltKey
Gets the state of the ALT key when the event was raised.
Declaration
public bool AltKey { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the ALT key was pressed when the event was raised; otherwise, false. |
CharacterCode
Gets the integer Unicode value of a key that was pressed.
Declaration
public int CharacterCode { get; }
Property Value
Type | Description |
---|---|
System.Int32 | An integer Unicode value of the key that was pressed if the EventType property value is "keypress"; otherwise, 0 (zero). |
ClientX
Gets the x-coordinate mouse position in pixels relative to the client area of the window.
Declaration
public int ClientX { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The x-coordinate mouse position in pixels if the Document Object Model (DOM) event includes position information; otherwise, 0 (zero). |
ClientY
Gets the y-coordinate mouse position in pixels relative to the client area of the window.
Declaration
public int ClientY { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The y-coordinate mouse position in pixels if the Document Object Model (DOM) event includes position information; otherwise, 0 (zero). |
CtrlKey
Gets the state of the CTRL key when the event was raised.
Declaration
public bool CtrlKey { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the CTRL key was pressed when the event was raised; otherwise, false. |
EventObject
Gets the underlying HTML event object.
Declaration
public ScriptObject EventObject { get; }
Property Value
Type | Description |
---|---|
ScriptObject | An HTML event object. |
EventType
Gets the name of the event raised by the browser.
Declaration
public string EventType { get; }
Property Value
Type | Description |
---|---|
System.String | An event name. |
KeyCode
Gets the integer Unicode value of a key that is associated with a keyboard event other than "keypress".
Declaration
public int KeyCode { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The integer Unicode value of a key involved in a keyboard event, if the event is not "keypress"; otherwise, 0 (zero). |
MouseButton
Gets the mouse buttons that were clicked at the time the event was raised.
Declaration
public MouseButtons MouseButton { get; }
Property Value
Type | Description |
---|---|
MouseButtons | One of the enumeration values that indicates which mouse button was clicked. |
OffsetX
Gets the x-coordinate mouse position in pixels relative to the HTML object that raised the event.
Declaration
public int OffsetX { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The x-coordinate mouse position in pixels if the Document Object Model (DOM) event includes position information; otherwise, 0 (zero). |
OffsetY
Gets the y-coordinate mouse position in pixels relative to the HTML object that raised the event.
Declaration
public int OffsetY { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The y-coordinate mouse position in pixels if the Document Object Model (DOM) event includes position information; otherwise, 0 (zero). |
ScreenX
Gets the x-coordinate mouse position in pixels relative to the user's screen.
Declaration
public int ScreenX { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The x-coordinate mouse position in pixels if the Document Object Model (DOM) event includes position information; otherwise, 0 (zero). |
ScreenY
Gets the y-coordinate mouse position in pixels relative to the user's screen.
Declaration
public int ScreenY { get; }
Property Value
Type | Description |
---|---|
System.Int32 | The y-coordinate mouse position in pixels if the Document Object Model (DOM) event includes position information; otherwise, 0 (zero). |
ShiftKey
Gets the state of the SHIFT key when the event was raised.
Declaration
public bool ShiftKey { get; }
Property Value
Type | Description |
---|---|
System.Boolean | true if the SHIFT key was pressed when the event was raised; otherwise, false. |
Source
Gets a reference to the Document Object Model (DOM) element or object that raised the event.
Declaration
public HtmlObject Source { get; }
Property Value
Type | Description |
---|---|
HtmlObject | A reference to the DOM element or object that raised the event. |
Methods
| Improve this Doc View SourcePreventDefault()
Specifies that the associated Document Object Model (DOM) element should not perform the default action for the current event.
Declaration
public void PreventDefault()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | An unexpected error occurred. |
StopPropagation()
Specifies that the event should not bubble up the Document Object Model (DOM) hierarchy.
Declaration
public void StopPropagation()
Exceptions
Type | Condition |
---|---|
System.InvalidOperationException | An unexpected error occurred. |