vcl-dxlayoutcontrol-dot-tdxcustomlayoutcontrol-dcf5fb68.md
Allows you to execute custom code when the mouse pointer moves into a hyperlink area within a layout item caption.
property OnHyperlinkMouseEnter: TdxHyperlinkMouseHoverEvent read; write;
You can handle OnHyperlinkMouseEnter and OnHyperlinkMouseLeave events to track mouse pointer movement through hyperlinks defined in layout item captions.
OnHyperlinkMouseEnter and OnHyperlinkMouseLeave events allow you to track mouse pointer movement through hyperlinks in all layout items in the control. Alternatively, you can handle the OnHyperlinkClick event of individual layout items.
The OnHyperlinkMouseEnter event occurs every time the mouse pointer moves into a hyperlink area in a layout item caption.
The following parameters are accessible within an OnHyperlinkMouseEnter event handler:
SenderProvides access to the layout control that raised the hyperlink mouse enter event.AArgsProvides access to information related to the hyperlink mouse enter event that occurred and allows you to identify the target hyperlink in a layout item caption. For example, you can use AArgs.HyperlinkIndex and AArgs.URI properties to identify the hovered hyperlink’s position and target URI.
Refer to TdxHyperlinkMouseHoverEvent and TdxHyperlinkEventArgs type descriptions for detailed information on all options available within an OnHyperlinkMouseEnter event handler.
The code example in this section demonstrates OnHyperlinkMouseEnter and OnHyperlinkMouseLeave event handlers that update the form caption as the mouse pointer moves between layout item hyperlinks.
The OnHyperlinkMouseEnter event handler displays the caption of the target layout item followed by the URI of a hyperlink in the form caption when the mouse pointer enters a hyperlink area. The OnHyperlinkMouseLeave event handler changes the form caption to a predefined string when the mouse pointer leaves a hyperlink.
Tip
This scenario can be useful if you need to display hyperlink targets without hints (if the CaptionOptions.ShowHyperlinkHint property of a layout item is set to bFalse, for example).
procedure TMyForm.dxLayoutControl1HyperlinkMouseEnter(Sender: TObject;
AArgs: TdxHyperlinkEventArgs); // Displays the hyperlink target in the form caption
var
ATargetItem: TdxCustomLayoutItem;
begin
ATargetItem := AArgs.Item as TdxCustomLayoutItem; // Obtains the target layout item
Caption := 'Target Item: ' + ATargetItem.CaptionOptions.Text + '; Navigate to ' + AArgs.URI;
end;
procedure TMyForm.dxLayoutControl1HyperlinkMouseLeave(Sender: TObject;
AArgs: TdxHyperlinkEventArgs); // Displays the predefined string instead of a hyperlink target
begin
Caption := 'Hyperlink Navigation in Layout Item Captions';
end;
void __fastcall TMyForm::dxLayoutControl1HyperlinkMouseEnter(TObject *Sender,
TdxHyperlinkEventArgs *AArgs) // Displays the hyperlink target in the form caption
{
TdxCustomLayoutItem *ATargetItem;
ATargetItem = dynamic_cast<TdxCustomLayoutItem*>(AArgs->Item); // Obtains the target layout item
Caption = "Target Item: " + ATargetItem->CaptionOptions->Text + "; Navigate to " + AArgs->URI;
}
void __fastcall TMyForm::dxLayoutControl1HyperlinkMouseLeave(TObject *Sender,
TdxHyperlinkEventArgs *AArgs) // Displays the predefined string instead of a hyperlink target
{
Caption = "Hyperlink Navigation in Layout Item Captions";
}
See Also
TdxCustomLayoutControl.OnHyperlinkClick Event
TdxCustomLayoutControl.OnShowHyperlinkHint Event
BBCode-Inspired Text Formatting Markup