vcl-dxlayoutcontrol-dot-tdxcustomlayoutcontrol-7ae8083d.md
Allows you to change a hyperlink hint before it appears.
property OnShowHyperlinkHint: TdxShowHyperlinkHintEvent read; write;
A hyperlink defined in a layout item caption can display the target URI in a hint when a user hovers the mouse pointer over the hyperlink. You can handle the OnShowHyperlinkHint event to change the hyperlink hint message for any hyperlink in any layout item.
The OnShowHyperlinkHint event allows you to implement a common hint display handler for all layout items in the control. Alternatively, you can handle the OnShowHyperlinkHint event of individual layout items.
The OnShowHyperlinkHint event occurs every time a hyperlink hint is about to appear.
The following parameters are accessible within an OnShowHyperlinkHint event handler:
SenderProvides access to the layout control that raised the hyperlink hint display event.AArgsProvides access to information related to the hyperlink hint display event that occurred. You can use the AArgs.Hint property to change hint text. To identify and access the target hyperlink’s parent layout item, use the AArgs.Item property.
Refer to TdxShowHyperlinkHintEvent and TdxShowHyperlinkHintEventArgs type descriptions for detailed information on all options accessible within an OnShowHyperlinkHint event handler.
The code example in this section demonstrates OnHyperlinkClick and OnShowHyperlinkHint event handlers. The OnHyperlinkClick handler requires a user to hold down the Ctrl key to activate a hyperlink. The OnShowHyperlinkHint event handler changes all hyperlink hints to prompt a user to hold the Ctrl key for hyperlink activation.
procedure TMyForm.dxLayoutControl1HyperlinkClick(Sender: TObject;
AArgs: TdxHyperlinkClickEventArgs);
begin
if AArgs.Shift <> [ssCtrl] then // If the Ctrl key is not held down
AArgs.Handled := True; // Prevents hyperlink activation
end;
procedure TMyForm.dxLayoutControl1ShowHyperlinkHint(Sender: TObject;
AArgs: TdxShowHyperlinkHintEventArgs);
var
AHintPrefix, AHintURI: string;
begin
AHintPrefix := 'Ctrl-click to navigate to ';
AHintURI := AArgs.URI.Remove(0, 8); // Removes the URI scheme from the hyperlink hint
AArgs.Hint := AHintPrefix + AHintURI; // Redefines the hyperlink hint
end;
void __fastcall TMyForm::dxLayoutControl1HyperlinkClick(TObject *Sender,
TdxHyperlinkClickEventArgs *AArgs)
{
if(AArgs->Shift != (TShiftState() << [ssCtrl])) // If the Ctrl key is held down
AArgs->Handled = true; // Prevents hyperlink activation
}
void __fastcall TMyForm::dxLayoutControl1ShowHyperlinkHint(TObject *Sender,
TdxShowHyperlinkHintEventArgs *AArgs)
{
UnicodeString AHintPrefix, AHintURI;
AHintPrefix = "Ctrl-click to navigate to ";
AHintURI = AArgs->URI.Remove(0, 8); // Removes the URI scheme from the hyperlink hint
AArgs->Hint = AHintPrefix + AHintURI; // Redefines the hyperlink hint
}
See Also
TdxCustomLayoutControl.OnHyperlinkClick Event
TdxCustomLayoutControl.OnHyperlinkMouseEnter Event
TdxCustomLayoutControl.OnHyperlinkMouseLeave Event
BBCode-Inspired Text Formatting Markup