ContinueBrowse example for Visual Basic

Private Sub LEADThumb1_ThumbnailEvent(ByVal Bitmap As Long, ByVal pszFilename As String, ByVal nStatusCode As Integer, ByVal nPercent As Integer)
Dim LEADRaster1 as LEADRaster
   'in this example, nCount is a global variable used to count the thumbnails
   If (nStatusCode = 0) Then 'successful thumbnail generation
      'save thumbnails in a multipage TIFF file
      Set LEADRaster1 = New LEADRaster
      LEADRaster1.Bitmap = Bitmap
      LEADRasterIO1.Save LEADRaster1, "d:\temp\thumbs.tif", FILE_TIF, 24, 0, SAVE_APPEND
      nCount = nCount + 1
      If nCount > 20 Then 'allow max of 20 thumbnails
         LEADThumb1.ContinueBrowse = False 'stop the browse
         Exit Sub
      End If
   End If
   LEADThumb1.ContinueBrowse = True 'continue the browse operation
End Sub