Collapsing event
Description
Occurs before a node in a TreeView DataWindow collapses.
PowerBuilder event information
Event ID: pbm_dwncollapsing
Argument |
Description |
---|---|
row |
Long by value. The number of the first |
grouplevel |
Long by value. The TreeView level of |
Return Values
Set the return code to affect the outcome of the event. Return
0 to continue processing (collapse the selected node) or return
any other value to cancel the collapse.
Usage
A TreeView node collapses when the user clicks the State icon
(-) in the TreeView DataWindow or uses any of the Collapse methods.
The Collapsing event occurs before the Collapsed event.
Examples
The following statements in the Collapsing event
script display a message box that allows the user to cancel the
operation. The message box does not display if the Collapsing event
was triggered by the CollapseAll or CollapseLevel methods:
1 |
Integer li_ret<br> <br>if row <>-1 then <br>   li_ret = MessageBox("Collapsing node",   &<br>      "Are you sure you want to collapse this node?",  &<br>      Exclamation!, OKCancel!)<br>   IF li_ret = 1 then<br>      return 0<br>    |
1 |
ELSE<br>      RETURN 1<br>   END IF<br>END IF |