TdxCustomFormattedLabelProperties.OnHyperlinkMouseLeave Event
Allows you to execute custom code when the mouse pointer leaves a hyperlink defined in the formatted label.
Declaration
property OnHyperlinkMouseLeave: TdxHyperlinkMouseHoverEvent read; write;
Remarks
You can handle OnHyperlinkMouseEnter and OnHyperlinkMouseLeave
events to track mouse pointer movement between hyperlinks defined in the formatted label.
Event Occurrence
The OnHyperlinkMouseLeave
event occurs every time the mouse pointer leaves a hyperlink area in the formatted label.
Event Parameters
The following parameters are accessible within an OnHyperlinkMouseLeave
event handler:
Sender
- Provides access to the formatted label that raised the hyperlink mouse leave event.
AArgs
- Provides 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 andAArgs
.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.
Code Example: Display Target URIs of Hot-Tracked Hyperlinks
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;