Export (0) Print
Expand All

WindowEventArgs.Window Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the window being acted upon by the ActivateEvent, Deactivate, and WindowSize methods.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Window Window { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Window
The window being acted upon by the ActivateEvent, Deactivate, and WindowSize methods.

The following code example creates an event handler for the WindowSize event. The event handler uses the Window property to display in the window caption the number of times that the window has been resized.

This example is for a document-level customization.

int resizeCount = 0;
private void DocumentWindowSize()
{
    this.WindowSize +=
        new Microsoft.Office.Tools.Word.WindowEventHandler(
        ThisDocument_WindowSize);
}

void ThisDocument_WindowSize(object sender,
    Microsoft.Office.Tools.Word.WindowEventArgs e)
{
    resizeCount++;
    e.Window.Caption = "Window resized " +
        resizeCount.ToString() + " times.";
}

Show:
© 2014 Microsoft