Show / Hide Table of Contents

Class HtmlEventArgs

Provides event details to event handlers.

Inheritance
System.Object
System.EventArgs
HtmlEventArgs
Inherited Members
System.EventArgs.Empty
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Browser
Assembly: OpenSilver.Browser.dll
Syntax
[NotImplemented]
public class HtmlEventArgs : EventArgs

Properties

| Improve this Doc View Source

AltKey

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.

| Improve this Doc View Source

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).

| Improve this Doc View Source

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).

| Improve this Doc View Source

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).

| Improve this Doc View Source

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.

| Improve this Doc View Source

EventObject

Gets the underlying HTML event object.

Declaration
public ScriptObject EventObject { get; }
Property Value
Type Description
ScriptObject

An HTML event object.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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).

| Improve this Doc View Source

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.

| Improve this Doc View Source

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).

| Improve this Doc View Source

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).

| Improve this Doc View Source

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).

| Improve this Doc View Source

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).

| Improve this Doc View Source

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.

| Improve this Doc View Source

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 Source

PreventDefault()

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.

| Improve this Doc View Source

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.

  • Improve this Doc
  • View Source