Skip to main content
Version: 20 R6

On Clicked

CodeCan be called byDefinition
44D View Pro Area - 4D Write Pro area - Button - Button Grid - Check Box - Combo Box - Dropdown list - Form - Hierarchical List - Input - List Box - List Box Column - Picture Button - Picture Pop up menu - Plug-in Area - Progress Indicators - Radio Button - Ruler - Spinner - Splitter - Stepper - Tab controlA click occurred on an object

Description

The On Clicked event is generated when the user clicks on an object.

Some form objects can be activated with the keyboard. For example, once a check box gets the focus, it can be entered using the space bar. In such a case, the On Clicked event is still generated.

The On Clicked event usually occurs once the mouse button is released. However, there are several exceptions:

  • Invisible buttons: The On Clicked event occurs as soon as the click is made and does not wait for the mouse button to be released.
  • Rulers: If the Execute object method option is set to true, the On Clicked event occurs as soon as the click is made.
  • Combo boxes: The On Clicked event occurs only if the user selects another value in the associated menu. A combo box must be treated as an enterable text area whose associated drop-down list provides default values. Consequently, you handle data entry within a combo box through the On Before Keystroke, On After Keystroke and On Data Change events.
  • Drop-down lists: The On Clicked event occurs only if the user selects another value in the menu. The On Data Change event allows you to detect the activation of the object when a value different from the current value is selected
  • When a list box input cell is being edited, the On Clicked event is generated when the mouse button is pressed, allowing to use the Contextual click command for example.

In the context of an On Clicked event, you can test the number of clicks made by the user by means of the Clickcount command.

On Clicked and On Double Clicked

After the On Clicked or On Double Clicked object event property is selected for an object, you can detect and handle the clicks within or on the object, using the FORM event command that returns On Clicked or On Double Clicked, depending on the case.

If both events are selected for an object, the On Clicked and then the On Double Clicked events will be generated when the user double-clicks the object.

4D View Pro

This event is generated when the user clicks anywhere on a 4D View Pro document. On this context, the event object returned by the FORM Event command contains:

PropertyTypeDescription
codelongintOn Clicked
descriptiontext"On Clicked"
objectNametext4D View Pro area name
sheetNametextName of the sheet of the event
rangeobjectCell range

Example

 If(FORM Event.code=On Clicked)
VP SET CELL STYLE(FORM Event.range;New object("backColor";"green"))
End if