vcl-cxcontrols-67813c61.md
Stores general information on a hyperlink-related event in a DevExpress control or its UI element.
TdxHyperlinkEventArgs = class(
TdxEventArgs
)
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.
The list below outlines key members of the TdxHyperlinkEventArgs class. These members allow you to identify the target hyperlink and its parent UI element.
HyperlinkIndexReturns the index of the target hyperlink in the parent UI element’s message.ItemProvides access to the parent UI element of the target hyperlink.Text | URIReturn the hyperlink’s anchor text and target URI.
The TdxHyperlinkMouseHoverEvent procedural type references a TdxHyperlinkEventArgs object as the AArgs parameter.
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;
void __fastcall TMyForm::dxLayoutControl1HyperlinkMouseEnter(TObject *Sender,
TdxHyperlinkEventArgs *AArgs) // Displays the hyperlink target in the form caption
{
TdxCustomLayoutItem *ATargetItem;
ATargetItem = dynamic_cast<TdxCustomLayoutItem*>(AArgs->Item); // Obtains the target layout item
Caption = "Target Item: " + ATargetItem->CaptionOptions->Text + "; Navigate to " + AArgs->URI;
}
void __fastcall TMyForm::dxLayoutControl1HyperlinkMouseLeave(TObject *Sender,
TdxHyperlinkEventArgs *AArgs) // Displays the predefined string instead of a hyperlink target
{
Caption = "Hyperlink Navigation in Layout Item Captions";
}
The following TdxHyperlinkEventArgs class descendants store information on dedicated hyperlink-related events:
TdxHyperlinkClickEventArgsStores information on a hyperlink click event in a DevExpress control or its UI element.TdxShowHyperlinkHintEventArgsStores information on a hyperlink hint display event in a DevExpress control or its UI element.
TObject TdxEventArgs TdxHyperlinkEventArgs
See Also