Share via


WindowEventArgs Class (2007 System)

Provides information for the ActivateEvent, Deactivate, and WindowSize events.

This API is not CLS-compliant. 

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

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public Class WindowEventArgs _
    Inherits EventArgs
'Usage
Dim instance As WindowEventArgs
[CLSCompliantAttribute(false)]
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public class WindowEventArgs : EventArgs
[CLSCompliantAttribute(false)]
[PermissionSetAttribute(SecurityAction::Demand, Name = L"FullTrust")]
public ref class WindowEventArgs : public EventArgs
public class WindowEventArgs extends EventArgs

Examples

The following code example creates an event handler for the WindowSize event. The event handler displays in the window caption the number of times that the window has been resized.

This example is for a document-level customization.

Private resizeCount As Integer = 0
Private Sub DocumentWindowSize()
    AddHandler Me.WindowSize, AddressOf ThisDocument_WindowSize
End Sub 

Private Sub ThisDocument_WindowSize(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.WindowEventArgs)
    resizeCount += 1
    e.Window.Caption = "Window resized " & resizeCount.ToString() & " times." 
End Sub
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.";
}

Inheritance Hierarchy

System.Object
  System.EventArgs
    Microsoft.Office.Tools.Word.WindowEventArgs

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

WindowEventArgs Members

Microsoft.Office.Tools.Word Namespace