ByteScout PDF Viewer SDK - VB.NET - Viewer Control Hosted in WPF - ByteScout

ByteScout PDF Viewer SDK – VB.NET – Viewer Control Hosted in WPF

  • Home
  • /
  • Articles
  • /
  • ByteScout PDF Viewer SDK – VB.NET – Viewer Control Hosted in WPF

ByteScout PDF Viewer SDK – VB.NET – Viewer Control Hosted in WPF

Application.xaml.vb

Class Application

    ' Application-level events, such as Startup, Exit, and DispatcherUnhandledException
    ' can be handled in this file.

End Class

MainWindow.xaml.vb

Class MainWindow

	Private Sub Window_Loaded(sender As Object, e As RoutedEventArgs)

		' Load a sample document on startup
		pdfViewerControl1.InputFile = "sample.pdf"

	End Sub

	Private Sub menuItemOpen_Click(sender As Object, e As RoutedEventArgs)

		Dim dlg = New Microsoft.Win32.OpenFileDialog()
		dlg.Filter = "PDF Files (*.pdf)|*.pdf|All Files (*.*)|*.*"

		Dim result As Boolean? = dlg.ShowDialog()

		If result = True Then
			pdfViewerControl1.InputFile = dlg.FileName
		End If

	End Sub
End Class


  Click here to get your Free Trial version of the SDK

prev
next