TdxHyperlinkEventArgs Class
Stores general information on a hyperlink-related event in a DevExpress control or its UI element.
Declaration
TdxHyperlinkEventArgs = class(
TdxEventArgs
)
Remarks
Hyperlink-related events allow you to change the behavior of hyperlinks defined in a caption or label of a DevExpress control or its UI element.
Main API Members
The list below outlines key members of the TdxHyperlinkEventArgs
class. These members allow you to identify the target hyperlink and its parent UI element.
- HyperlinkIndex
- Returns the index of the target hyperlink in the parent UI element’s message.
- Item
- Provides access to the parent UI element of the target hyperlink.
- Text | URI
- Return the hyperlink’s anchor text and target URI.
Direct TdxHyperLinkEventArgs Class Reference
The TdxHyperlinkMouseHoverEvent procedural type references a TdxHyperlinkEventArgs
object as the AArgs
parameter.
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;
Terminal TdxHyperlinkEventArgs Class Descendants
The following TdxHyperlinkEventArgs
class descendants store information on dedicated hyperlink-related events:
- TdxHyperlinkClickEventArgs
- Stores information on a hyperlink click event in a DevExpress control or its UI element.
- TdxShowHyperlinkHintEventArgs
- Stores information on a hyperlink hint display event in a DevExpress control or its UI element.