TdxHyperlinkEventArgs.Item Property
Provides access to the target hyperlink’s parent UI element.
Declaration
property Item: TObject read;
Property Value
| Type | Description |
|---|---|
| TObject | The target hyperlink’s parent UI element. Cast this parameter value to the corresponding terminal control or UI element class to access all public API members. Refer to the following section for detailed information on parent UI element types in different DevExpress products: Parent UI Element Types. Tip You can call the |
Remarks
You can use the Item property to identify and access the parent UI element of the occurred event’s target hyperlink. The HyperlinkIndex property allows you to identify the target hyperlink’s position in the parent UI element’s message.
Parent UI Element Types
The actual type of the parent UI element accessible through the Items property depends on the class that declares the corresponding hyperlink-related event:
- Formatted Label Editors
- The actual
Itemtype is TdxFormattedLabel or TdxDBFormattedLabel.AArgs.ItemandSenderparameter values always match in the parent event’s handler. - Layout Control
- The actual
Itemtype is always the corresponding terminal TdxCustomLayoutItem descendant.
Code Example: Display Target URIs of Hot-Tracked Hyperlinks in Layout Items
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;