Steps to reproduce:
1. Load a PDF document with 0 pages
2. Enter some text in the search textbox and click the next/prev buttons
Expected: the search textbox should be either disabled or should ignore any search operation
Actual: an error occurs
Workaround:
Private Sub pdf_Viewer_DocumentLoaded(sender As Object, e As EventArgs)
If pdf_Viewer.Document.Pages.Count = 0 Then
pdf_Toolbar.SearchTextBox.Enabled = False
pdf_Toolbar.NextButton.Enabled = False
pdf_Toolbar.PreviousButton.Enabled = False
Else
pdf_Toolbar.SearchTextBox.Enabled = True
pdf_Toolbar.NextButton.Enabled = True
pdf_Toolbar.PreviousButton.Enabled = True
End If
End Sub