Skip to content

OnItemClick - AbstractTreeView

Fired whenever a user clicks an item

Type: Event

Parameters

Parameter Type Description
hItem Handle Item handle
ByRef bCancel Boolean Can be used to cancel the event by returning True

Syntax

Procedure OnItemClick Handle hItem ByRef Boolean bCancel

Description

The OnItemClick event is fired whenever a user clicks an item to make it become the current item.

Sample

Procedure OnItemClick Handle hItem Boolean ByRef bCancel
    // do something when user clicks on the item
End_Procedure

Sample

This sample demonstrates the use of the bCancel parameter to cancel the clicked item becoming the current item.

Procedure OnItemClick Handle hItem Boolean ByRef bCancel
    Move True to bCancel
End_Procedure

Sample

This sample shows how to retrieve the ItemLabel of a tree item when the user clicks that tree item and use it to execute an action.

Procedure OnItemClick Handle hItem Boolean ByRef bCancel
    String sValue

    Get ItemLabel hItem to sValue
    If (sValue contains "Account") Begin
        Send ProcessAccount
    End
    Else If (sValue contains "Customer") Begin
        Send ProcessCustomer
    End
End_Procedure