Compartir a través de


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

'Declaration
<BrowsableAttribute(True)> _
Public Event MouseClick As MouseEventHandler
[BrowsableAttribute(true)]
public event MouseEventHandler MouseClick
[BrowsableAttribute(true)]
public:
 event MouseEventHandler^ MouseClick {
    void add (MouseEventHandler^ value);
    void remove (MouseEventHandler^ value);
}
[<BrowsableAttribute(true)>]
member MouseClick : IEvent<MouseEventHandler,
    MouseEventArgs>
JScript does not support events.

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 Consuming 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 Sub OvalShape1_MouseClick() Handles OvalShape1.MouseClick
        ' Display a crosshair cursor.
        OvalShape1.Cursor = Cursors.Cross
    End Sub
private void ovalShape1_MouseClick(object sender, 
            System.Windows.Forms.MouseEventArgs e)
        {
            // Display a crosshair cursor.
            ovalShape1.Cursor = Cursors.Cross;
        }

.NET Framework Security

See Also

Reference

Shape Class

Microsoft.VisualBasic.PowerPacks Namespace

Other Resources

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)