Skip to main content

TdxCustomSpreadSheet.OnHyperlinkExecute Event

Allows you to perform custom actions on executing a hyperlink.

Declaration

property OnHyperlinkExecute: TdxSpreadSheetHyperlinkExecuteEvent read; write;

Remarks

This event occurs every time the control is about to:

  • Navigate to display the cell range to which the executed hyperlink is referring;

  • Open an external hyperlink target in the default web browser or mail client application, depending on the URI scheme of the executed hyperlink’s reference.

Handle the OnHyperlinkExecute event to override or complement the default activation routines for all or only specifc hyperlinks in a spreadsheet document that you can identify by their hints, anchor texts, references, and indexes within a worksheet’s hyperlink collection. For instance, you can identify a hyperlink as external and forbid end-users to open it, or invoke a notification or confirmation message box on clicking the hyperlink. The following code example implements an OnHyperlinkExecute event handler that allows you to open only internal hyperlinks in a spreadsheet:

procedure TMyForm.dxSpreadSheet1HyperlinkExecute(Sender: TdxCustomSpreadSheet; AHyperlink: TdxSpreadSheetHyperlink; var AHandled: Boolean);
begin
  if AHyperlink.ValueType <> hvtReference then  // If the activated hyperlink is not internal...
    AHandled := True;  // Prevents hyperlink execution
end;

Refer to the TdxSpreadSheetHyperlinkExecuteEvent procedural type description for detailed information on all parameters accessible within an OnHyperlinkExecute event handler.

Note

A hyperlink’s Execute procedure call raises the OnHyperlinkExecute event only if the hyperlink has a specified reference or address.

See Also