This documentation is archived and is not being maintained.

Application.ActiveWindow Property

Gets a reference to a Window object that represents the currently active window.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

public abstract Window ActiveWindow { get; }

Property Value

Type: Microsoft.Office.InfoPath.Window
A Window that provides access to the current window.

Using the ActiveWindow property, you can gain immediate access to the window that is currently being viewed by the user, and then use the properties and methods of the Window object that it returns.

This member can be accessed without restrictions.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

In the following example, the ActiveWindow property used to retrieve the Window object for the current window, and then the Caption property is used to display the title bar text of the window.

MessageBox.Show(this.Application.ActiveWindow.Caption);
Show: