Skip to content

OnClick - Button

Called when the button is clicked

Type: Event

Syntax

Procedure OnClick

Description

The OnClick event message is sent by this object every time it is pressed. By default, it has no definition; it is for your use.

Object oButton1 is a Button
    set location to 10 10
    set label to "&Report"

    Procedure OnClick
        Delegate Send RunReport
    End_Procedure
End_Object

On_Key Key_Alt+Key_R Send KeyAction to RButton

Quite often the action of a button will be to send a message to its parent. Although the message will delegate automatically to the parent, it is advisable to explicitly delegate the message within the OnClick procedure. This makes your intention clear.