Partager 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
Public MustOverride ReadOnly Property ActiveWindow As Window
    Get
'Usage
Dim instance As Application
Dim value As Window

value = instance.ActiveWindow
public abstract Window ActiveWindow { get; }

Property Value

Type: Microsoft.Office.InfoPath.Window
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 InfoPath Filler.

Examples

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