FileLoad Example for Visual Basic

Dim RasterKrnDlg As New LEADRasterDlgKrn
Dim WithEvents RasterFileDlg As LEADRasterDlgFile

Private Sub FileLoad_Click()
RasterFileDlg.DialogTitle = "LEADTOOLS Open dialog box"
RasterFileDlg.InitialDir = "c:\images"
RasterFileDlg.FileDlgFlags = OPEN_ALLOWMULTI
RasterFileDlg.UIFlags = OPEN_LOADBITMAP Or _
                       OPEN_SHOW_PROGRESSIVE Or _
                           OPEN_SHOW_MULTIPAGE Or _
                           OPEN_SHOW_LOADROTATED Or _
                           OPEN_SHOW_LOADCOMPRESSED Or _
                           OPEN_SHOW_FILEINFO Or _
                           OPEN_SHOW_PREVIEW Or _
                           OPEN_SHOW_DELPAGE Or _
                           OPEN_VIEWTOTALPAGES Or _
                           OPEN_GENERATETHUMBNAIL
   RasterFileDlg.ShowOpenDlg (hWnd) 
End Sub

Private Sub Form_Load()
Set RasterFileDlg = New LEADRasterDlgFile
RasterKrnDlg.InitDlg INIT_WITHOUT_COLOR
End Sub

Private Sub RasterFileDlg_FileLoad(ByVal iTotalPercent As Integer, ByVal FilePercent As Integer) 
   If (FilePercent = 100) Then
      LEADRasterView1.Raster.Bitmap = RasterFileDlg.Bitmap
      MsgBox RasterFileDlg.FileName
   End If
End Sub

Private Sub Form_Unload(Cancel As Integer)
RasterKrnDlg.FreeDlg
End Sub