ActiveReports 19 .NET Edition
MESCIUS.ActiveReports.Viewer.Wpf Assembly / GrapeCity.ActiveReports.Viewer.Wpf Namespace / Viewer Class / HyperLink Event
Example

In This Topic
    HyperLink Event (Viewer)
    In This Topic
    Occurs when a hyperlink is clicked in the currently opened document.
    Syntax
    'Declaration
     
    Public Event HyperLink As HyperLinkEventHandler
    public event HyperLinkEventHandler HyperLink
    Event Data

    The event handler receives an argument of type HyperLinkEventArgs containing data related to this event. The following HyperLinkEventArgs properties provide information specific to this event.

    PropertyDescription
    Gets the mouse button that the user clicked to raise the event.  
    Gets or sets a value indicating whether a new browser tab or window should be initialized to open the target of the hyperlink.  
    Gets or sets a value indicating whether the HyperLink event is handled.  
    Gets or sets a value that indicates the target of the hyperlink.  
    Example
    viewer.HyperLink += (sender, e) =>
    {
        // Check if the hyperlink is not null or empty
        if (!string.IsNullOrEmpty(e.HyperLink))
        {
            // Open the hyperlink in the default web browser
            System.Diagnostics.Process.Start(e.HyperLink);
            // Optionally, set Handled to true to prevent the default behavior
            e.Handled = true;
        }
    };
    See Also