# GrapeCity.ActiveReports.Viewer.Win.Viewer.HyperLink

## Content

<div class="doc-site-dotnet-api-container">




<h1 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_HyperLink" data-uid="GrapeCity.ActiveReports.Viewer.Win.Viewer.HyperLink" class="text-break">HyperLink Event
</h1>
<div class="markdown level0 summary"><p>Occurs when the user clicks on text or an image that has a hyperlink assigned to it.</p>
</div>
<div class="markdown level0 conceptual"></div>
<h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.ActiveReports.Viewer.Win.html">GrapeCity.ActiveReports.Viewer.Win</a></h6>
<h6><strong>Assembly</strong>: MESCIUS.ActiveReports.Viewer.Win.dll</h6>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_HyperLink_syntax">Syntax</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public event HyperLinkEventHandler HyperLink</code></pre>
</div>
<h5 class="returns">Returns</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="../MESCIUS.ActiveReports.Viewer.Common/GrapeCity.ActiveReports.Viewer.Win.HyperLinkEventHandler.html">HyperLinkEventHandler</a></td>
      <td>Occurs when the user clicks on text or an image that has a hyperlink assigned to it.</td>
    </tr>
  </tbody>
</table>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_HyperLink_remarks"><strong>Remarks</strong></h5>
<div class="markdown level0 remarks"><p>The <a class="xref" href="../MESCIUS.ActiveReports.Viewer.Common/GrapeCity.ActiveReports.Viewer.Win.HyperLinkEventArgs.html">HyperLinkEventArgs</a> provides information about the hyperlink, including its URL.
Event handlers can use this information to perform custom actions, such as navigating to the hyperlink or displaying it in a web browser.</p>
</div>
<h5 id="GrapeCity_ActiveReports_Viewer_Win_Viewer_HyperLink_examples"><strong>Examples</strong></h5>
<pre><code class="lang-csharp">public partial class MyForm : Form
{
	private Viewer viewer;
	public MyForm()
	{
		InitializeComponent();
		// Initialize the viewer
		viewer = new Viewer();
		this.Controls.Add(viewer);
		// Subscribe to the HyperLink event
		viewer.HyperLink += Viewer_HyperLink;
	}

	private void Viewer_HyperLink(object sender, HyperLinkEventArgs 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;
		}
	}
}</code></pre>

</div>
