This page explains the steps and algorithm of implementing custom multikey press event handling and how to make it work in your application. Custom multikey press event handling in VB.NET can be applied with ByteScout PDF Viewer SDK. ByteScout PDF Viewer SDK is the component that helps in adding pdf viewer into your desktop WinForms application. User may select multiple areas with mouse, can use keyboard shortcuts and zoom in or zoom out and change scaling. You may read coordinates, handle custom painting code and retrieve text inside selection area.
Want to speed up the application development? Then this VB.NET, code samples for VB.NET, developers help to speed up the application development and writing a code when using ByteScout PDF Viewer SDK. If you want to know how it works, then this VB.NET sample code should be copied and pasted into your application’s code editor. Then just compile and run it. Updated and detailed documentation and tutorials are available along with installed ByteScout PDF Viewer SDK if you’d like to learn more about the topic and the details of the API.
If you want to try other samples for VB.NET then free trial version of ByteScout PDF Viewer SDK is available on our website.
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
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, 27)
Me.pdfViewerControl1.Margin = New System.Windows.Forms.Padding(4)
Me.pdfViewerControl1.MouseMode = Bytescout.PDFViewer.MouseMode.Hand
Me.pdfViewerControl1.Name = "pdfViewerControl1"
Me.pdfViewerControl1.RegistrationKey = Nothing
Me.pdfViewerControl1.RegistrationName = Nothing
Me.pdfViewerControl1.ResetRotationOnPageChange = False
Me.pdfViewerControl1.Scale = 100
Me.pdfViewerControl1.SelectionColor = System.Drawing.Color.Red
Me.pdfViewerControl1.ShowImageObjects = True
Me.pdfViewerControl1.ShowTextObjects = True
Me.pdfViewerControl1.ShowVectorObjects = True
Me.pdfViewerControl1.Size = New System.Drawing.Size(1123, 636)
Me.pdfViewerControl1.TabIndex = 0
'
'toolStrip1
'
Me.toolStrip1.ImageScalingSize = New System.Drawing.Size(20, 20)
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(1123, 27)
Me.toolStrip1.TabIndex = 1
Me.toolStrip1.Text = "toolStrip1"
'
'tsbOpen
'
Me.tsbOpen.Image = Global.MultikeyPressEventHandling.My.Resources.Resources.folder_page
Me.tsbOpen.ImageTransparentColor = System.Drawing.Color.Magenta
Me.tsbOpen.Name = "tsbOpen"
Me.tsbOpen.Size = New System.Drawing.Size(99, 24)
Me.tsbOpen.Text = "&Open PDF"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1123, 663)
Me.Controls.Add(Me.pdfViewerControl1)
Me.Controls.Add(Me.toolStrip1)
Me.Margin = New System.Windows.Forms.Padding(4)
Me.Name = "Form1"
Me.Text = "Multikey Press Event - Try Shift-A, Ctrl-Alt-Shift-A"
Me.toolStrip1.ResumeLayout(False)
Me.toolStrip1.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
#End Region
Private WithEvents pdfViewerControl1 As Bytescout.PDFViewer.PDFViewerControl
Private toolStrip1 As System.Windows.Forms.ToolStrip
Private WithEvents tsbOpen As System.Windows.Forms.ToolStripButton
End Class
60 Day Free Trial or Visit ByteScout PDF Viewer SDK Home Page
Explore ByteScout PDF Viewer SDK Documentation
Explore Samples
Sign Up for ByteScout PDF Viewer SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
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
Private Sub PdfViewerControl1_PreProcessKey(source As Object, keyData As Keys, ByRef handled As Boolean) Handles pdfViewerControl1.PreProcessKey
If keyData = (Keys.A Or Keys.Shift) Then
MessageBox.Show("Shift-A")
handled = True
End If
If keyData = (Keys.A Or Keys.Control Or Keys.Alt Or Keys.Shift) Then
MessageBox.Show("Ctrl-Alt-Shift-A")
handled = True
End If
End Sub
End Class
60 Day Free Trial or Visit ByteScout PDF Viewer SDK Home Page
Explore ByteScout PDF Viewer SDK Documentation
Explore Samples
Sign Up for ByteScout PDF Viewer SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
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
60 Day Free Trial or Visit ByteScout PDF Viewer SDK Home Page
Explore ByteScout PDF Viewer SDK Documentation
Explore Samples
Sign Up for ByteScout PDF Viewer SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout PDF Viewer SDK Home Page
Explore ByteScout PDF Viewer SDK Documentation
Explore Samples
Sign Up for ByteScout PDF Viewer SDK Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples