Skip to content

Commit b91bd36

Browse files
authored
Merge pull request #1204 from syncfusion-content/939394
939394 :UG documentation about error occurred event in the WinForms PdfViewer
2 parents 6bc5b9e + 76b361f commit b91bd36

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

WindowsForms-toc.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3702,6 +3702,7 @@
37023702
<li><a href="/windowsforms/PDF-Viewer/Localization">Localization</a></li>
37033703
<li><a href="/windowsforms/PDF-Viewer/Working-with-themes">Working with themes</a></li>
37043704
<li><a href="/windowsforms/PDF-Viewer/Interaction-Modes">Working with Interaction Modes</a></li>
3705+
<li><a href="/windowsforms/PDF-Viewer/Interaction-Modes">Working with ErrorOccured Event</a></li>
37053706
<li>
37063707
How To
37073708
<ul>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
layout: post
3+
title: Working with ErrorOccured Event in Windows Forms PDF Viewer | Syncfusion&reg;
4+
description: Learn about Working with ErrorOccured Event in Syncfusion&reg; Windows Forms PDF Viewer (PdfViewerControl) control and more details.
5+
platform: windowsforms
6+
control: PdfViewerControl
7+
documentation: ug
8+
---
9+
10+
# Working with ErrorOccured Event in Windows Forms PDF Viewer (PdfViewerControl)
11+
12+
PDF Viewer provides support to identify the error using the ErrorOccured Event,The ErrorOccurred[
13+
https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html#Syncfusion_Windows_Forms_PdfViewer_PdfViewerControl_ErrorOccurred
14+
] event in the PdfViewerControl is triggered whenever an error occurs within the control. This event provides an opportunity to handle errors effectively by allowing developers to log the details or display appropriate messages to users when an issue arises within the PdfViewerControl[https://help.syncfusion.com/cr/windowsforms/Syncfusion.Windows.Forms.PdfViewer.PdfViewerControl.html].
15+
16+
{% tabs %}
17+
{% highlight c# %}
18+
19+
public Form1()
20+
{
21+
InitializeComponent();
22+
PdfViewer.ErrorOccurred += PdfViewer_ErrorOccurred;
23+
}
24+
25+
private void PdfViewer_ErrorOccurred(object sender, ErrorOccurredEventArgs e)
26+
{
27+
// Log error message
28+
Console.WriteLine("Error occurred in PdfViewerControl: " + e.Message);
29+
30+
// Display error message to the user
31+
MessageBox.Show("An error occurred while viewing the PDF: " + e.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
32+
}
33+
34+
{% endhighlight %}
35+
{% endtabs %}

0 commit comments

Comments
 (0)