TdxCustomLayoutControl.OnHyperlinkMouseLeave Event
Allows you to execute custom code when the mouse pointer leaves a hyperlink within a layout item caption.
Declaration
property OnHyperlinkMouseLeave: TdxHyperlinkMouseHoverEvent read; write;
Remarks
You can handle OnHyperlinkMouseEnter and OnHyperlinkMouseLeave
events to track mouse pointer movement through hyperlinks defined in layout item captions.
Layout Control and Layout Item Events
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.
Event Occurrence
The OnHyperlinkMouseLeave
event occurs every time the mouse pointer leaves a hyperlink area in a layout item caption.
Event Parameters
The following parameters are accessible within an OnHyperlinkMouseEnter
event handler:
Sender
- Provides access to the layout control that raised the hyperlink mouse leave event.
AArgs
- Provides access to information related to the mouse leave event that occurred and allows you to identify the target hyperlink in the layout item caption. 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 all options available within an OnHyperlinkMouseLeave
event handler.
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 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;