MouseClick Event

Shape.MouseClick Event

 

Occurs when the shape is clicked by the mouse.

Namespace:   Microsoft.VisualBasic.PowerPacks
Assembly:  Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)

[BrowsableAttribute(true)]
public event MouseEventHandler MouseClick

Clicking a mouse button when the pointer is over a shape typically raises the following series of events from the control:

MouseDown 

Click 

MouseClick 

MouseUp 

Two clicks that occur close enough in time, as determined by the mouse settings of the user's operating system, will generate a MouseDoubleClick event instead of the second MouseClick event.

System_CAPS_noteNote

Click events are logically higher-level events of a shape. They are often raised by other actions, such as pressing the ENTER key when the shape has focus.

For more information about how to handle events, see Handling and Raising Events.

The following example shows how to respond to the MouseClick event in an event handler. This example requires that you have a OvalShape control named OvalShape1 on a form.

private void ovalShape1_MouseClick(object sender, 
    System.Windows.Forms.MouseEventArgs e)
{
    // Display a crosshair cursor.
    ovalShape1.Cursor = Cursors.Cross;
}

Return to top
Show:
© 2016 Microsoft