Share via


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)

Syntax

'Declaration
'Usage

Property Value

A Window that provides access to the current window.

Remarks

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 Office InfoPath 2007.

Example

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);
MessageBox.Show(Me.Application.ActiveWindow.Caption)

See Also

Reference

Application Class
Application Members
Microsoft.Office.InfoPath Namespace