PdfViewer.DialogShowing Event
Occurs before the File open dialog and Print dialog is displayed.
public event DialogShowingEventHandler PdfViewer.DialogShowing;
Public Event PdfViewer.DialogShowing As DialogShowingEventHandler
Event Handler
Licensing Info
This event is a DynamicPDF Viewer feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Viewer selected.
- A DynamicPDF Viewer for .NET v3.X Developer license.
Examples
This example shows, how to cancel a file open dialog display using DialogShowing eventImports System
Imports System.Windows.Forms
Imports ceTe.DynamicPDF.Viewer
Public Class Form1
Inherits System.Windows.Forms.Form
Private dpdfViewer As PdfViewer
Public Sub New()
InitializeComponent()
End Sub
[STAThread]
Private Shared Sub Main()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.dpdfViewer = New PdfViewer()
Me.Controls.Add(dpdfViewer)
AddHandler DialogShowing, AddressOf Me.pdfViewer_DialogShowing
End Sub
Private Sub pdfViewer_DialogShowing(sender As Object, e As ceTe.DynamicPDF.Viewer.DialogShowingEventArgs)
' Preventing File Open dialog from displaying using DialogShowing event.
If e.DisplayingDialogType = DialogType.FileOpenDialog Then
e.Cancel = True
End If
End Sub
End Class
using System;
using System.Windows.Forms;
using ceTe.DynamicPDF.Viewer;
namespace DynamicPDFViewerDemo
{
public class Form1 : System.Windows.Forms.Form
{
private PdfViewer dpdfViewer;
public Form1()
{
InitializeComponent();
}
static void Main()
{
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.dpdfViewer = new PdfViewer();
this.Controls.Add(dpdfViewer);
DialogShowing += new ceTe.DynamicPDF.Viewer.DialogShowingEventHandler(this.pdfViewer_DialogShowing);
}
private void pdfViewer_DialogShowing(object sender, ceTe.DynamicPDF.Viewer.DialogShowingEventArgs e)
{
// Preventing File Open dialog from displaying using DialogShowing event.
if (e.DisplayingDialogType == DialogType.FileOpenDialog)
{
e.Cancel = true;
}
}
}
}