PdfViewer.SearchProgressing Event

Occurs when the search for a string is in progress.

public event SearchProgressingEventHandler PdfViewer.SearchProgressing;
Public Event PdfViewer.SearchProgressing As SearchProgressingEventHandler

Event Handler

SearchProgressingEventHandler

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 search term, match option used, current page numberwhere search is going on and cancelling the search using SearchProgressingEventArgs 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.SearchProgressing, AddressOf MyPdfViewer_SearchProgressing
    End Sub

    Private Sub MyPdfViewer_SearchProgressing(ByVal sender As Object, ByVal e As ceTe.DynamicPDF.Viewer.SearchProgressingEventArgs)
        ' Get the search string.
        Dim MysearchTerm As String = e.SearchTerm

        ' Get the Match option used for searching.
        Dim [option] As MatchOptions = DirectCast(e.MatchOption, MatchOptions)

        ' If user wants to cancel the search. Use the below commented code.
        'e.Cancel = true;

        ' Get the current page number where search is in progress.
        Dim pagenumber As Integer = e.CurrentPageNumber
    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);
            SearchProgressing += new ceTe.DynamicPDF.Viewer.SearchProgressingEventHandler(this.pdfViewer_SearchProgressing);
        }

        private void pdfViewer_SearchProgressing(object sender, ceTe.DynamicPDF.Viewer.SearchProgressingEventArgs e)
        {
            // Get the search string.
            string searchTerm = e.SearchTerm;

            // Get the Match option used for searching.
            MatchOptions option = (MatchOptions)e.MatchOption;

            // If user wants to cancel the search. Use the below commented code.
            //e.Cancel = true;

            // Get the current page number where search is in progress.
            int pagenumber = e.CurrentPageNumber;
        }
    }
}         

Remarks

To cancel the search which is in progress set the value of Cancel to true otherwise by default it is false.

See Also

ceTe.DynamicPDF.Viewer

In this topic