System.Windows.Forms.HtmlDocument.AttachEventHandler Method

Adds an event handler for the named HTML DOM event.

Syntax

public void AttachEventHandler (string eventName, EventHandler eventHandler)

Parameters

eventName
The name of the event you want to handle.
eventHandler
The managed code that handles the event.

Remarks

You should not attach an event to the document or one of its objects until the document has completed loading. The earliest you should call this method is in the WebBrowser.DocumentCompleted event of the System.Windows.Forms.WebBrowser control.

This method allows you to attach handlers to unmanaged DOM events not exposed by System.Windows.Forms.HtmlDocument. For more information about available unmanaged DOM events, see Accessing Unexposed Members on the Managed HTML Document Object Model and the IHTMLDocument interfaces: tp://go.microsoft.com/fwlink/?LinkId=104882, tp://go.microsoft.com/fwlink/?LinkId=104884, tp://go.microsoft.com/fwlink/?LinkId=104886, tp://go.microsoft.com/fwlink/?LinkId=104887, tp://go.microsoft.com/fwlink/?LinkId=104888.

Requirements

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