HtmlWindow.AttachEventHandler Method (String, EventHandler)

 

Adds an event handler for the named HTML DOM event.

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

public void AttachEventHandler(
	string eventName,
	EventHandler eventHandler
)

Parameters

eventName
Type: System.String

The name of the event you want to handle.

eventHandler
Type: System.EventHandler

A reference to the managed code that handles the event.

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

.NET Framework
Available since 2.0
Return to top
Show: