Zdarzenie DocumentBase.Deactivate

Występuje, gdy okno aktywnego dokumentu traci fokus.

Przestrzeń nazw:  Microsoft.Office.Tools.Word
Zestaw:  Microsoft.Office.Tools.Word.v4.0.Utilities (w Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Składnia

'Deklaracja
Public Event Deactivate As WindowEventHandler
public event WindowEventHandler Deactivate

Uwagi

Deactivate Zdarzenie zachodzi, gdy zwolnisz dokumentu.

Przykłady

Poniższy kod wyświetla komunikat, kiedy dokument jest aktywny.Aby wykorzystać ten przykład, należy uruchomić go z klasy ThisDocument w projekcie na poziomie dokumentu.

Private Sub DocumentDeactivate()
    AddHandler Me.Deactivate, AddressOf ThisDocument_Deactivate
End Sub

Private Sub ThisDocument_Deactivate(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.WindowEventArgs)
    MessageBox.Show("The document has been deactivated")
End Sub
private void DocumentDeactivate()
{
    this.Deactivate += new Microsoft.Office.Tools.Word.WindowEventHandler(ThisDocument_Deactivate);
}

void ThisDocument_Deactivate(object sender, Microsoft.Office.Tools.Word.WindowEventArgs e)
{
    MessageBox.Show ("The document has been deactivated");
}

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

DocumentBase Klasa

Przestrzeń nazw Microsoft.Office.Tools.Word