Shape.DoubleClick Event
Occurs when the shape is double-clicked.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (in Microsoft.VisualBasic.PowerPacks.Vs.dll)
Syntax
'Declaration
<BrowsableAttribute(True)> _
Public Event DoubleClick As EventHandler
[BrowsableAttribute(true)]
public event EventHandler DoubleClick
[BrowsableAttribute(true)]
public:
event EventHandler^ DoubleClick {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member DoubleClick : IEvent<EventHandler,
EventArgs>
JScript does not support events.
Remarks
A double-click is determined by the mouse settings of the user's operating system. The user can set the amount of time between clicks of a mouse button that determine what should be considered a double-click instead of two clicks. The DoubleClick event is raised every time that a control is double-clicked. For example, if you have event handlers for the Click and DoubleClick events of a Shape, the Click and DoubleClick events are raised when the shape is double-clicked, and both methods are called.
For more information about how to handle events, see Consuming Events.
Examples
The following example shows how to respond to the DoubleClick event in an event handler. This example requires that you have a RectangleShape control named RectangleShape1 on a form.
Private Sub RectangleShape1_DoubleClick(
) Handles RectangleShape1.DoubleClick
If RectangleShape1.BackColor = Color.Blue Then
RectangleShape1.BackColor = Color.Red
Else
RectangleShape1.BackColor = Color.Blue
End If
End Sub
private void rectangleShape1_DoubleClick(object sender, System.EventArgs e)
{
if (rectangleShape1.BackColor == Color.Blue)
{
rectangleShape1.BackColor = Color.Red;
}
else
{
rectangleShape1.BackColor = Color.Blue;
}
}
.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)