Link Search Menu Expand Document

Sample PDF Viewing UI Application - VB.NET

PDF Viewer SDK sample in VB.NET demonstrating ‘Sample PDF Viewing UI Application’

Form1.Designer.vb
��Partial Class Form1

	''' <summary>

	''' Required designer variable.

	''' </summary>

	Private components As System.ComponentModel.IContainer = Nothing



	''' <summary>

	''' Clean up any resources being used.

	''' </summary>

	''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>

	Protected Overrides Sub Dispose(disposing As Boolean)

		If disposing AndAlso (components IsNot Nothing) Then

			components.Dispose()

		End If

		MyBase.Dispose(disposing)

	End Sub



	#Region "Windows Form Designer generated code"



	''' <summary>

	''' Required method for Designer support - do not modify

	''' the contents of this method with the code editor.

	''' </summary>

	Private Sub InitializeComponent()

        Me.pdfViewerControl1 = New Bytescout.PDFViewer.PDFViewerControl

        Me.toolStrip1 = New System.Windows.Forms.ToolStrip

        Me.tsbOpen = New System.Windows.Forms.ToolStripButton

        Me.toolStrip1.SuspendLayout()

        Me.SuspendLayout()

        '

        'pdfViewerControl1

        '

        Me.pdfViewerControl1.BackColor = System.Drawing.SystemColors.ButtonShadow

        Me.pdfViewerControl1.Dock = System.Windows.Forms.DockStyle.Fill

        Me.pdfViewerControl1.Location = New System.Drawing.Point(0, 25)

        Me.pdfViewerControl1.MouseMode = Bytescout.PDFViewer.MouseMode.Hand

        Me.pdfViewerControl1.Name = "pdfViewerControl1"

        Me.pdfViewerControl1.ShowToolbar = True

        Me.pdfViewerControl1.Size = New System.Drawing.Size(842, 514)

        Me.pdfViewerControl1.TabIndex = 0

        '

        'toolStrip1

        '

        Me.toolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.tsbOpen})

        Me.toolStrip1.Location = New System.Drawing.Point(0, 0)

        Me.toolStrip1.Name = "toolStrip1"

        Me.toolStrip1.Size = New System.Drawing.Size(842, 25)

        Me.toolStrip1.TabIndex = 1

        Me.toolStrip1.Text = "toolStrip1"

        '

        'tsbOpen

        '

        Me.tsbOpen.Image = Global.Sample_UI_Application.My.Resources.Resources.folder_page

        Me.tsbOpen.ImageTransparentColor = System.Drawing.Color.Magenta

        Me.tsbOpen.Name = "tsbOpen"

        Me.tsbOpen.Size = New System.Drawing.Size(80, 22)

        Me.tsbOpen.Text = "&Open PDF"

        '

        'Form1

        '

        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)

        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font

        Me.ClientSize = New System.Drawing.Size(842, 539)

        Me.Controls.Add(Me.pdfViewerControl1)

        Me.Controls.Add(Me.toolStrip1)

        Me.Name = "Form1"

        Me.Text = "Form1"

        Me.toolStrip1.ResumeLayout(False)

        Me.toolStrip1.PerformLayout()

        Me.ResumeLayout(False)

        Me.PerformLayout()



    End Sub



	#End Region



	Private pdfViewerControl1 As Bytescout.PDFViewer.PDFViewerControl

	Private toolStrip1 As System.Windows.Forms.ToolStrip

    Private WithEvents tsbOpen As System.Windows.Forms.ToolStripButton

End Class




Form1.vb
Imports System.Windows.Forms

Public Partial Class Form1
    Inherits Form

	Public Sub New()
		InitializeComponent()
	End Sub

    Private Sub tsbOpen_Click(ByVal sender As Object, ByVal e As EventArgs) Handles tsbOpen.Click

        Using openFileDialog As New OpenFileDialog()

            openFileDialog.Title = "Open PDF Document"
            openFileDialog.Filter = "PDF Files (*.pdf)|*.pdf|All Files|*.*"

            If openFileDialog.ShowDialog() = DialogResult.OK Then

                Me.Text = openFileDialog.FileName

                Cursor = Cursors.WaitCursor

                Try
                    pdfViewerControl1.InputFile = openFileDialog.FileName
                Catch exception As Exception
                    MessageBox.Show(exception.Message)
                Finally
                    Cursor = Cursors.[Default]
                End Try

            End If

        End Using

    End Sub

End Class

Program.vb
Imports System.Collections.Generic
Imports System.Windows.Forms

NotInheritable Class Program
	Private Sub New()
	End Sub
	''' <summary>
	''' The main entry point for the application.
	''' </summary>
	<STAThread> _
	Friend Shared Sub Main()
		Application.EnableVisualStyles()
		Application.SetCompatibleTextRenderingDefault(False)
		Application.Run(New Form1())
	End Sub
End Class

Resources.Designer.vb
��'------------------------------------------------------------------------------

' <auto-generated>

'     This code was generated by a tool.

'     Runtime Version:2.0.50727.5448

'

'     Changes to this file may cause incorrect behavior and will be lost if

'     the code is regenerated.

' </auto-generated>

'------------------------------------------------------------------------------



Option Strict On

Option Explicit On



Imports System



Namespace My.Resources

    

    'This class was auto-generated by the StronglyTypedResourceBuilder

    'class via a tool like ResGen or Visual Studio.

    'To add or remove a member, edit your .ResX file then rerun ResGen

    'with the /str option, or rebuild your VS project.

    '''<summary>

    '''  A strongly-typed resource class, for looking up localized strings, etc.

    '''</summary>

    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0"),  _

     Global.System.Diagnostics.DebuggerNonUserCodeAttribute(),  _

     Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(),  _

     Global.Microsoft.VisualBasic.HideModuleNameAttribute()>  _

    Friend Module Resources

        

        Private resourceMan As Global.System.Resources.ResourceManager

        

        Private resourceCulture As Global.System.Globalization.CultureInfo

        

        '''<summary>

        '''  Returns the cached ResourceManager instance used by this class.

        '''</summary>

        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _

        Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager

            Get

                If Object.ReferenceEquals(resourceMan, Nothing) Then

                    Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Sample_UI_Application.Resources", GetType(Resources).Assembly)

                    resourceMan = temp

                End If

                Return resourceMan

            End Get

        End Property

        

        '''<summary>

        '''  Overrides the current thread's CurrentUICulture property for all

        '''  resource lookups using this strongly typed resource class.

        '''</summary>

        <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)>  _

        Friend Property Culture() As Global.System.Globalization.CultureInfo

            Get

                Return resourceCulture

            End Get

            Set

                resourceCulture = value

            End Set

        End Property

        

        Friend ReadOnly Property folder_page() As System.Drawing.Bitmap

            Get

                Dim obj As Object = ResourceManager.GetObject("folder_page", resourceCulture)

                Return CType(obj,System.Drawing.Bitmap)

            End Get

        End Property

    End Module

End Namespace


Settings.Designer.vb
��'------------------------------------------------------------------------------

' <auto-generated>

'     This code was generated by a tool.

'     Runtime Version:2.0.50727.5448

'

'     Changes to this file may cause incorrect behavior and will be lost if

'     the code is regenerated.

' </auto-generated>

'------------------------------------------------------------------------------



Namespace Properties





	<System.Runtime.CompilerServices.CompilerGeneratedAttribute> _

	<System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "8.0.0.0")> _

	Friend NotInheritable Partial Class Settings

		Inherits Global.System.Configuration.ApplicationSettingsBase



		Private Shared defaultInstance As Settings = DirectCast(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New Settings()), Settings)



		Public Shared ReadOnly Property [Default]() As Settings

			Get

				Return defaultInstance

			End Get

		End Property

	End Class

End Namespace


Download Source Code (.zip)

Return to the previous page Explore PDF Viewer SDK


Copyright © 2016 - 2021 ByteScout