WindowEventArgs.Window Özellik

Tanım

ActivateEvent, Ve yöntemleri tarafından üzerinde işlem yapılan pencereyi alır Deactivate WindowSize .

public Microsoft.Office.Interop.Word.Window Window { get; }

Özellik Değeri

Window

ActivateEvent, Ve yöntemleri tarafından üzerinde işlem yapılan pencere Deactivate WindowSize .

Örnekler

Aşağıdaki kod örneği, olay için bir olay işleyicisi oluşturur WindowSize . Olay işleyicisi, pencerenin yeniden Window boyutlandırıldığı pencere başlığında görüntülenecek özelliği kullanır.

Bu örnek, belge düzeyinde özelleştirme içindir

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

Şunlara uygulanır