FileLoad Example for Visual Basic

 Dim RasterKrnDlg As LEADRasterDlgKrn_U
Dim WithEvents RasterFileDlg As LEADRasterDlgFile_U

Private Sub btnFileLoad_Click()
    RasterFileDlg.DialogTitle = "LEADTOOLS Open dialog box"
    RasterFileDlg.InitialDir = "d:\temp\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 RasterKrnDlg = New LEADRasterDlgKrn_U
    Set RasterFileDlg = New LEADRasterDlgFile_U
    RasterKrnDlg.InitDlg INIT_WITHOUT_COLOR
End Sub

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

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