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)

Syntax

[BrowsableAttribute(true)]
public event MouseEventHandler MouseClick
public:
[BrowsableAttribute(true)]
event MouseEventHandler^ MouseClick {
    void add(MouseEventHandler^ value);
    void remove(MouseEventHandler^ value);
}
[<BrowsableAttribute(true)>]
member MouseClick : IEvent<MouseEventHandler,
    MouseEventArgs>
<BrowsableAttribute(True)>
Public Event MouseClick As MouseEventHandler

Remarks

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.

Note

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.

Examples

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;
}
Private Sub OvalShape1_MouseClick() Handles OvalShape1.MouseClick
    ' Display a crosshair cursor.
    OvalShape1.Cursor = Cursors.Cross
End Sub

See Also

Shape Class
Microsoft.VisualBasic.PowerPacks Namespace
How to: Draw Lines with the LineShape Control (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls (Visual Studio)
Introduction to the Line and Shape Controls (Visual Studio)

Return to top