DocumentBase.WindowSize Event


Occurs when the document window is resized or moved.

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

public event WindowEventHandler WindowSize

The following code example creates a handler for the WindowSize event. The event handler displays in the window caption the number of times that the window has been resized. To use this example, run it from the ThisDocument class in a document-level project.

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

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