vcl-dxformattedlabel-dot-tdxcustomformattedlabelproperties-e636f84b.md
Allows you to execute custom code when the mouse pointer leaves a hyperlink defined in the formatted label.
property OnHyperlinkMouseLeave: TdxHyperlinkMouseHoverEvent read; write;
You can handle OnHyperlinkMouseEnter and OnHyperlinkMouseLeave events to track mouse pointer movement between hyperlinks defined in the formatted label.
The OnHyperlinkMouseLeave event occurs every time the mouse pointer leaves a hyperlink area in the formatted label.
The following parameters are accessible within an OnHyperlinkMouseLeave event handler:
SenderProvides access to the formatted label that raised the hyperlink mouse leave event.AArgsProvides access to information related to the occurred hyperlink mouse enter event and allows you to identify the target hyperlink in the formatted label. 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 options available within OnHyperlinkMouseEnter and OnHyperlinkMouseLeave event handlers.
The code example in this section demonstrates OnHyperlinkMouseEnter and OnHyperlinkMouseLeave event handlers that update the form caption as the mouse pointer moves between hyperlinks defined in a formatted label.
The OnHyperlinkMouseEnter event handler displays the target URI of a hyperlink in the form caption when the mouse pointer enters the hyperlink’s 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 ShowHyperlinkHint property is set to False).
procedure TMyForm.dxFormattedLabel1HyperlinkMouseEnter(Sender: TObject;
AArgs: TdxHyperlinkEventArgs); // Displays the hyperlink target in the form caption
begin
Caption := 'Navigate to ' + AArgs.URI;
end;
procedure TMyForm.dxFormattedLabel1HyperlinkMouseLeave(Sender: TObject;
AArgs: TdxHyperlinkEventArgs); // Displays the predefined string instead of a hyperlink target
begin
Caption := 'Hyperlink Navigation in Formatted Labels';
end;
void __fastcall TMyForm::dxFormattedLabel1HyperlinkMouseEnter(TObject *Sender,
TdxHyperlinkEventArgs *AArgs) // Displays the hyperlink target in the form caption
{
Caption = "Navigate to " + AArgs->URI;
}
void __fastcall TMyForm::dxFormattedLabel1HyperlinkMouseLeave(TObject *Sender,
TdxHyperlinkEventArgs *AArgs) // Displays the predefined string instead of a hyperlink target
{
Caption = "Hyperlink Navigation in Formatted Labels";
}
See Also
TdxCustomFormattedLabelProperties.OnHyperlinkClick Event
TdxCustomFormattedLabelProperties.OnShowHyperlinkHint Event
BBCode-Inspired Text Formatting Markup
TdxCustomFormattedLabelProperties Class