ClickEventHandler Delegate (2007 System)

Represents the method that will handle the BeforeDoubleClick and BeforeRightClick events of a Document.

This API is not CLS-compliant. 

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

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
Public Delegate Sub ClickEventHandler ( _
    sender As Object, _
    e As ClickEventArgs _
)
'Usage
Dim instance As New ClickEventHandler(AddressOf HandlerMethod)
[CLSCompliantAttribute(false)]
public delegate void ClickEventHandler(
    Object sender,
    ClickEventArgs e
)
[CLSCompliantAttribute(false)]
public delegate void ClickEventHandler(
    Object^ sender, 
    ClickEventArgs^ e
)
JScript does not support delegates.

Parameters

Remarks

When you create a ClickEventHandler delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, until you remove the delegate. For more information about delegates, see Events and Delegates.

Examples

The following code example demonstrates an event handler for the BeforeDoubleClick event. The event handler displays a message when the user double-clicks the document.

This example is for a document-level customization.

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

See Also

Reference

Microsoft.Office.Tools.Word Namespace