Compartilhar via


WindowEventArgs Classe (sistema de 2007)

Fornece informações sobre como a ActivateEvent, Deactivate, e WindowSize eventos.

Esta API não compatível com CLS. 

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

Sintaxe

<CLSCompliantAttribute(False)> _
<PermissionSetAttribute(SecurityAction.Demand, Name := "FullTrust")> _
Public Class WindowEventArgs _
    Inherits EventArgs

Dim instance As WindowEventArgs
[CLSCompliantAttribute(false)]
[PermissionSetAttribute(SecurityAction.Demand, Name = "FullTrust")]
public class WindowEventArgs : EventArgs

Exemplos

O exemplo de código a seguir cria um manipulador de eventos para o WindowSize evento. O manipulador de eventos exibe na legenda da janela, o número de vezes que a janela for redimensionada.

Este exemplo é para uma personalização em nível de documento.

Private resizeCount AsInteger = 0
PrivateSub DocumentWindowSize()
    AddHandlerMe.WindowSize, AddressOf ThisDocument_WindowSize
EndSubPrivateSub ThisDocument_WindowSize(ByVal sender AsObject, ByVal e As Microsoft.Office.Tools.Word.WindowEventArgs)
    resizeCount += 1
    e.Window.Caption = "Window resized " & resizeCount.ToString() & " times."EndSub
int resizeCount = 0;
privatevoid 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.";
}

Hierarquia de herança

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

Acesso thread-safe

Quaisquer membros static (Shared no Visual Basic) públicos deste tipo são thread-safe. Não há garantia de que qualquer membro de instância seja thread-safe.

Consulte também

Referência

Membros WindowEventArgs

Namespace Microsoft.Office.Tools.Word