Επεξεργασία

Κοινή χρήση μέσω


Control.OnMouseClick(MouseEventArgs) Method

Definition

Raises the MouseClick event.

protected:
 virtual void OnMouseClick(System::Windows::Forms::MouseEventArgs ^ e);
protected virtual void OnMouseClick (System.Windows.Forms.MouseEventArgs e);
abstract member OnMouseClick : System.Windows.Forms.MouseEventArgs -> unit
override this.OnMouseClick : System.Windows.Forms.MouseEventArgs -> unit
Protected Overridable Sub OnMouseClick (e As MouseEventArgs)

Parameters

e
MouseEventArgs

An MouseEventArgs that contains the event data.

Remarks

Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising Events.

The OnMouseClick method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.

Notes to Inheritors

When overriding OnMouseClick(MouseEventArgs) in a derived class, be sure to call the base class's OnMouseClick(MouseEventArgs) method so that registered delegates receive the event.

Applies to