-
Notifications
You must be signed in to change notification settings - Fork 0
/
Form1.vb
24 lines (21 loc) · 894 Bytes
/
Form1.vb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Imports DevExpress.XtraPdfViewer
Imports System
Imports System.Windows.Forms
Namespace ViewerCustomCommand
Partial Public Class Form1
Inherits Form
Private Sub ReplacePdfViewerCommandFactoryService(ByVal control As PdfViewer)
Dim service As IPdfViewerCommandFactoryService = control.GetService(Of IPdfViewerCommandFactoryService)()
If service Is Nothing Then
Return
End If
control.RemoveService(GetType(IPdfViewerCommandFactoryService))
control.AddService(GetType(IPdfViewerCommandFactoryService), New CustomPdfViewerCommandFactoryService(control,service))
End Sub
Public Sub New()
InitializeComponent()
pdfViewer1.LoadDocument("..\..\Demo.pdf")
ReplacePdfViewerCommandFactoryService(pdfViewer1)
End Sub
End Class
End Namespace