'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.
Property | Description |
---|---|
Button | Gets the mouse button that the user clicked to raise the event. |
CreateNewTab | Gets or sets a value indicating whether a new browser tab or window should be initialized to open the target of the hyperlink. |
Handled | Gets or sets a value indicating whether the HyperLink event is handled. |
HyperLink | 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