The Click event passes an EventArgs to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (button, number of clicks, wheel rotation, or location), use the MouseClick event. However, the MouseClick event will not be raised if the click is caused by action other than that of the mouse, such as pressing the ENTER key.

A double-click is determined by the mouse settings of the user's operating system. The user can set the time between clicks of a mouse button that should be considered a double-click rather than two clicks. The Click event is raised every time a control is double-clicked. For example, if you have event handlers for the Click and DoubleClick events of a Form, the Click and DoubleClick events are raised when the form is double-clicked and both methods are called. If a control is double-clicked and that control does not support the DoubleClick event, the Click event might be raised twice.

You must set the StandardClick value ofControlStyles to true for this event to be raised.

Notes to Inheritors:

Inheriting from a standard Windows Forms control and changing the StandardClick or StandardDoubleClick values of ControlStyles to true can cause unexpected behavior or have no effect at all if the control does not support the Click or DoubleClick events.

The following table lists Windows Forms controls and which event (Click or DoubleClick) is raised in response to the mouse action specified.

' This example uses the Parent property and the Find method of Control to set' properties on the parent control of a Button and its Form. The example assumes' that a Button control named button1 is located within a GroupBox control. The ' example also assumes that the Click event of the Button control is connected to' the event handler method defined in the example.PrivateSub button1_Click(sender AsObject, e As System.EventArgs) Handles button1.Click
' Get the control the Button control is located in. In this case a GroupBox.Dim control As Control = button1.Parent
' Set the text and backcolor of the parent control.
control.Text = "My Groupbox"
control.BackColor = Color.Blue
' Get the form that the Button control is contained within.Dim myForm As Form = button1.FindForm()
' Set the text and color of the form containing the Button.
myForm.Text = "The Form of My Control"
myForm.BackColor = Color.Red
EndSub