Compartilhar via


DocumentBase.BeforeDoubleClick Event

Occurs when the editing area of the document window is double-clicked, before the default double-click action.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Syntax

'Declaration
Public Event BeforeDoubleClick As ClickEventHandler
public event ClickEventHandler BeforeDoubleClick

Remarks

To prevent the default double-click action from occurring, set the Cancel argument of the provided CancelEventArgs object to true.

Examples

The following code example displays a message when you double-click the document. To use this example, run it from the ThisDocument class in a document-level project.

Private Sub DocumentBeforeDoubleClick()
    AddHandler Me.BeforeDoubleClick, AddressOf ThisDocument_BeforeDoubleClick
End Sub 

Private Sub ThisDocument_BeforeDoubleClick(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.ClickEventArgs)
    MessageBox.Show(Me.Name & " was double-clicked.")
End Sub
private void DocumentBeforeDoubleClick()
{
    this.BeforeDoubleClick += new Microsoft.Office.Tools.Word.ClickEventHandler(ThisDocument_BeforeDoubleClick);
}

void ThisDocument_BeforeDoubleClick(object sender, Microsoft.Office.Tools.Word.ClickEventArgs e)
{
    MessageBox.Show(this.Name + " was double-clicked.");
}

.NET Framework Security

See Also

Reference

DocumentBase Class

Microsoft.Office.Tools.Word Namespace