Aracılığıyla paylaş


Document.WindowSize Olay

Belge penceresini yeniden boyutlandırılabilir veya taşındığında gerçekleşir.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word (Microsoft.Office.Tools.Word.dll içinde)

Sözdizimi

'Bildirim
Event WindowSize As WindowEventHandler
event WindowEventHandler WindowSize

Örnekler

Aşağıdaki kod örneği için bir işleyici oluşturur WindowSize olay. Olay işleyicisi pencere baþlýðýnýn pencere yeniden boyutlandırılamaz sayısını görüntüler. Bu bir uygulama düzeyinde eklentisi örneğidir.

Private resizeCount As Integer = 0
Private Sub DocumentWindowSize()
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    AddHandler vstoDoc.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()
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    vstoDoc.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.";
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Document Arabirim

Microsoft.Office.Tools.Word Ad Alanı