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 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:
MouseClick
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.
注意
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
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
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)