Skip to main content
All docs
V24.2

TdxCustomFormattedLabelProperties.OnHyperlinkMouseEnter Event

Allows you to execute custom code when the mouse pointer moves into a hyperlink area defined in the formatted label.

Declaration

property OnHyperlinkMouseEnter: 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 OnHyperlinkMouseEnter event occurs every time the mouse pointer moves into a hyperlink area in the formatted label.

Event Parameters

The following parameters are accessible within an OnHyperlinkMouseEnter event handler:

Sender
Provides access to the formatted label that raised the hyperlink mouse enter event.
AArgs
Provides access to information related to the hyperlink mouse enter event that occurred 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 all 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;
See Also