Back to Devexpress

TdxShowHyperlinkHintEventArgs Class

vcl-cxcontrols-b1b1d355.md

latest4.8 KB
Original Source

TdxShowHyperlinkHintEventArgs Class

Stores information on a hyperlink hint display event in a DevExpress control or its UI element.

Declaration

delphi
TdxShowHyperlinkHintEventArgs = class(
    TdxHyperlinkEventArgs
)

Remarks

Hyperlink hint display events allow you to customize individual hyperlink hints defined in a DevExpress control or its UI element.

Main API Members

The list below outlines key members of the TdxShowHyperlinkHintEventArgs class. These members allow you to identify the target hyperlink and change its hint message before it appears.

HintAllows you to change the message of the target hyperlink hint.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 code example in this section demonstrates handlers of OnHyperlinkClick and OnShowHyperlinkHint events. The OnHyperlinkClick event 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.

delphi
procedure TMyForm.dxFormattedLabel1PropertiesHyperlinkClick(Sender: TObject;
  AArgs: TdxHyperlinkClickEventArgs); // Requires the Ctrl key for hyperlink activation
begin
  if AArgs.Shift <> [ssCtrl] then // If the Ctrl key is not held down
    AArgs.Handled := True; // Prevents hyperlink activation
end;

procedure TMyForm.dxFormattedLabel1PropertiesShowHyperlinkHint(Sender: TObject;
  AArgs: TdxShowHyperlinkHintEventArgs); // Changes all hyperlink hints
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;
cpp
void __fastcall TMyForm::dxFormattedLabel1PropertiesHyperlinkClick(TObject *Sender,
  TdxHyperlinkClickEventArgs *AArgs) // Requires the Ctrl key for hyperlink activation
{
  if(AArgs->Shift != (TShiftState() << [ssCtrl])) // If the Ctrl key is not held down
    AArgs->Handled = true; // Prevents hyperlink activation
}

void __fastcall TMyForm::dxFormattedLabel1PropertiesShowHyperlinkHint(TObject *Sender,
  TdxShowHyperlinkHintEventArgs *AArgs) // Changes all hyperlink hints
{
  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
}

Direct TdxShowHyperlinkHintEventArgs Class References

The following procedural types reference a TdxShowHyperlinkHintEventArgs object as the AArgs parameter:

TdxMessageDialogShowHyperlinkHintDelegateThe procedural type for a hyperlink hint display handler in a message dialog.TdxShowHyperlinkHintEventThe procedural type for hyperlink hint display events in DevExpress controls and their UI elements.

Inheritance

TObject TdxEventArgs TdxHyperlinkEventArgs TdxShowHyperlinkHintEventArgs

See Also

TdxHyperlinkClickEventArgs Class

TdxHyperlinkEventArgs Class

BBCode-Inspired Text Formatting Markup

TdxShowHyperlinkHintEventArgs Members

cxControls Unit