Skip to main content

TdxCustomTileControl.OnActionBarsHide Event

Enables you to respond to hiding action bars caused by specific actions and prohibits the change.

Declaration

property OnActionBarsHide: TdxTileControlActionBarVisibilityChangeEvent read; write;

Remarks

The Sender parameter references the tile control.

The AReason parameter specifies what caused action bars to be hidden. Refer to the TdxTileControlActionBarVisibilityChangeReason type description to learn about the available parameter values.

Pass True as the AHandled parameter to prohibit hiding action bars in response to the AReason action.

The following code example shows how to handle the OnActionBarsHide event to prohibit hiding action bars in response to left- or right-clicking a specific action button (actionBarItem).

procedure <Form>.<TileControl>ActionBarsHide(Sender: TdxCustomTileControl; AReason: TdxTileControlActionBarVisibilityChangeReason; var AHandled: Boolean);
begin
  if ((AReason in [abvcrActionButtonClick, abvcrMouseRightClick]) and
    ((Sender.ActiveHitTest.HitObject <> nil) and
    (Sender.ActiveHitTest.HitObject is TdxTileControlActionBarItemViewInfo) and
    (TdxTileControlActionBarItemViewInfo(Sender.ActiveHitTest.HitObject).Item = actionBarItem))) then
    AHandled := True;
end;

This event handler sets the AHandled event parameter to True only when an end-user clicks the actionBarItem action button. To ascertain that this button is clicked, the event handler identifies the UI element located under the mouse pointer using the ViewInfo object returned by the tile control’s ActiveHitTest.HitObject property.

Handle the OnActionBarsHide event in combination with the OnActionBarsShow event to completely control switching the action bar visibility.

See Also