ShowDirectoryDlg Example for Visual Basic

Private Sub btnShowDirectory_Click()
    Dim nRet As Integer

    RasterFileDlg.Directory = "d:\temp\images\"
    RasterFileDlg.ShowHelpButton = True
    RasterFileDlg.Filter = "ALL|*.*|LEAD|*.cmp|JPEG|*.JPG"
    RasterFileDlg.DialogTitle = "Select a Directory Please"
    RasterFileDlg.EnableMethodErrors = False
    
    nRet = RasterFileDlg.ShowDirectoryDlg(hWnd)
    If (nRet = 0 And RasterFileDlg.DialogStatus = DLG_OK) Then
        MsgBox RasterFileDlg.Directory
    End If
End Sub

Private Sub RasterFileDlg_DlgHelp(ByVal DlgFrom As Long, ByVal CtlID As Long)
   Select Case DlgFrom

   Case HELP_GETDIRECTORY
      MsgBox "'Help from GetDirectory dialog "

   Case HELP_FILESASSOCIATION
      MsgBox "'Help from FilesAssociation dialog "

   Case HELP_OPEN
      MsgBox " Help from Open dialog"

   Case HELP_FILESASSOCIATION
      MsgBox "'Help from FilesAssociation dialog "

   Case HELP_SAVE
      MsgBox " Help from Save dialog "

   Case HELP_FILECONVERSION
      MsgBox " 'Help from FileConversion dialog "

   Case HELP_PRINTPREVIEW
      MsgBox " Help from PrintPreview dialog "

   Case HELP_PRINTSTITCHEDIMAGES
      MsgBox " Help from PrintStitchedImages dialog "

   End Select
End Sub