WebBrowser.DocumentTitleChanged Event

Definition

Occurs when the DocumentTitle property value changes.

C#
[System.ComponentModel.Browsable(false)]
public event EventHandler DocumentTitleChanged;
C#
[System.ComponentModel.Browsable(false)]
public event EventHandler? DocumentTitleChanged;

Event Type

Attributes

Examples

The following code example demonstrates how to use a handler for the DocumentTitleChanged event to update the form title bar with the title of the current document. This example requires that your form contains a WebBrowser control called webBrowser1.

For the complete code example, see How to: Add Web Browser Capabilities to a Windows Forms Application.

C#
// Updates the title bar with the current document title.
private void webBrowser1_DocumentTitleChanged(object sender, EventArgs e)
{
    this.Text = webBrowser1.DocumentTitle;
}

Remarks

You can handle this event to update the title bar of your application with the current value of the DocumentTitle property.

For more information about handling events, see Handling and Raising Events.

Applies to

Product Versions
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

See also