Condividi tramite


Evento DocumentBase.Deactivate

Viene generato quando la finestra attiva del documento perde lo stato attivo.

Spazio dei nomi:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Sintassi

'Dichiarazione
Public Event Deactivate As WindowEventHandler
public event WindowEventHandler Deactivate

Note

L'evento Deactivate non viene generato quando si scarica il documento.

Esempi

Nell'esempio di codice riportato di seguito viene illustrato come visualizzare un messaggio alla disattivazione del documento. Per utilizzare questo esempio, eseguirlo dalla classe ThisDocument in un progetto a livello di documento.

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

Sicurezza di .NET Framework

Vedere anche

Riferimenti

DocumentBase Classe

Spazio dei nomi Microsoft.Office.Tools.Word