PdfViewer.LinkClicked Event

Occurs when user clicks on a link.

public event LinkClickEventHandler PdfViewer.LinkClicked;
Public Event PdfViewer.LinkClicked As LinkClickEventHandler

Event Handler

LinkClickEventHandler

Licensing Info

This event is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:

Examples

This example demonstrates, how to get the link Action and how to cancel the action associated with the link using LinkClickedEventArgs class.

Imports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer

Public Class Form1
    Inherits System.Windows.Forms.Form

    Private MyPdfViewer As PdfViewer

    Sub New()
        InitializeComponent()
    End Sub

    Shared Sub Main()
        Application.Run(New Form1())
    End Sub	
		    
    Private Sub InitializeComponent()
        Me.MyPdfViewer = New PdfViewer()
        Me.Controls.Add(MyPdfViewer)
        AddHandler MyPdfViewer.LinkClicked, AddressOf MyPdfViewer_LinkClicked
    End Sub

    Private Sub MyPdfViewer_LinkClicked(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.LinkClickedEventArgs)
        ' Get the action associated with the link.
        Dim MyAction As ceTe.DynamicPDF.Viewer.Action = e.Action
        
        ' Get the action type.
        Dim MyActionType As ceTe.DynamicPDF.Viewer.ActionType = MyAction.ActionType

        ' Cancel the action associated with the link
        e.Cancel = True
    End Sub

End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;

namespace DynamicPDFViewerDemo
{
    public class Form1 : Form
    {
        private PdfViewer dpdfViewer;

        public Form1()
        {
             InitializeComponent();
        }

        [STAThread]
        static void Main()
        {
            Application.Run(new Form1());
        }																																			

        private void InitializeComponent()
        {
            this.dpdfViewer = new PdfViewer();
            this.Controls.Add(dpdfViewer);
            LinkClicked += new ceTe.DynamicPDF.Viewer.LinkClickEventHandler(this.pdfViewer_LinkClicked);
        }

        private void pdfViewer_LinkClicked(object sender, ceTe.DynamicPDF.Viewer.LinkClickedEventArgs e)
        {
            // Get the action associated with the link.
            ceTe.DynamicPDF.Viewer.Action action = e.Action;

            // Get the action type.
            ceTe.DynamicPDF.Viewer.ActionType actionType = action.ActionType;

            // Cancel the action associated with the link
            e.Cancel = true;
        }
    }
}         

See Also

ceTe.DynamicPDF.Viewer

In this topic