Partager via


WindowEventArgs, interface

Fournit des informations pour les événements ActivateEvent, Deactivate et WindowSize.

Espace de noms :  Microsoft.Office.Tools.Word
Assembly :  Microsoft.Office.Tools.Word (dans Microsoft.Office.Tools.Word.dll)

Syntaxe

'Déclaration
<GuidAttribute("767d9ec0-c72c-4f66-892b-be4a4b20eba3")> _
Public Interface WindowEventArgs
[GuidAttribute("767d9ec0-c72c-4f66-892b-be4a4b20eba3")]
public interface WindowEventArgs

Le type WindowEventArgs expose les membres suivants.

Propriétés

  Nom Description
Propriété publique Window Obtient la fenêtre sur laquelle agissent les méthodes ActivateEvent, Deactivate et WindowSize.

Début

Exemples

L'exemple de code suivant crée un gestionnaire d'événements pour l'événement WindowSize. Le gestionnaire d'événements affiche, dans le titre de la fenêtre, le nombre de fois que la fenêtre a été redimensionnée.

Cet exemple illustre une personnalisation au niveau du document.

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.";
}

Voir aussi

Référence

Microsoft.Office.Tools.Word, espace de noms