System.Windows.Forms.HtmlElement.KeyDown Event

Occurs when the user presses a key on the keyboard.

Syntax

public event HtmlElementEventHandler KeyDown

Remarks

HtmlElement.KeyDown occurs before HtmlElement.KeyPress, which in turns occurs before HtmlElement.KeyUp.

You can cancel the default action for a HtmlElement.KeyDown event on an element by setting the HtmlElementEventArgs.ReturnValue property of the System.Windows.Forms.HtmlElementEventArgs class to true.

A HtmlElement.KeyDown event on an element will also occur on that element's parent elements and on the System.Windows.Forms.HtmlDocument class itself, unless you set the HtmlElementEventArgs.BubbleEvent property of the System.Windows.Forms.HtmlElementEventArgs class to true.

For more information about the difference between canceling event bubbling and canceling the default action on an event, see tp://msdn.microsoft.com/en-us/library/ms533022.aspx.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 2.0.0.0