Skip to main content

TcxCustomTabControl.OnGetTabHint Event

Enables you to customize tab hints and dynamically control their visibility.

Declaration

property OnGetTabHint: TcxGetTabHintEvent read; write;

Remarks

This event fires when the control’s Properties.ShowTabHints property is set to True and a hint is about to be displayed for the tab located under the mouse pointer.

Sender specifies the page or tab control, which owns the handled tab.

TabIndex specifies the index of the tab.

Set the new hint via AHint. In tab controls, this parameter is initialized with an empty string. In page controls, the parameter is initialized with the Hint property value of the page that corresponds to the handled tab. If the property is unassigned, the page’s caption is used instead.

Pass False as ACanShow to hide the hint. This parameter is initialized with True only for the following tabs:

  • Tabs with truncated captions (when the caption displays an ellipsis to indicate that a tab’s width is insufficient to display the entire caption);

  • In page controls, tabs for pages with assigned hints.

The following example shows how to comment on disabled tabs using hints. Make certain that the page control’s Properties.ShowTabHints property is set to True.

procedure <Form>.<cxPageControl>GetTabHint(Sender: TObject; ATabIndex: Integer; var AHint: string; var ACanShow: Boolean);
begin
  if not <cxPageControl>.Pages[ATabIndex].Enabled then
  begin
    ACanShow := True; // Always display hints for disabled tabs
    AHint := AHint + #13#10 + 'This tab is disabled. Complete the form above to proceed.';
  end;
end;
See Also