System.Windows.Forms.HtmlElement.KeyPress Event

Occurs when the user presses and releases a key on the keyboard.

Syntax

public event HtmlElementEventHandler KeyPress

Remarks

HtmlElement.KeyPress occurs after HtmlElement.KeyDown and before HtmlElement.KeyUp.

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

A HtmlElement.KeyPress 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