Click Event - Event Procedures

Click Event — Event Procedures

See Also         Example

To create an event procedure that runs when the Click event occurs, set the OnClick property to [Event Procedure], and click the Build button .

Syntax

Private Sub Form_Click( )

Private Sub controlname_Click( )

The Click event procedure has the following argument.

Argument Description
controlname The name of the control whose Click event procedure you want to run.

Remarks

When the user double-clicks a list box, the following events occur, in this order:

MouseDown Þ MouseUp Þ Click Þ DblClick

Other controls have a similar order of events. When you're creating event procedures for these related events, be sure that their event procedure code doesn't conflict. (For example, the DblClick event procedure shouldn't contain code that cancels actions carried out in the Click event procedure.)

You can't cancel the Click event.