Board index » Visual Studio » Common Dialog control problem
|
anon6654
|
Common Dialog control problem
Visual Studio175
I have problems with that the control passes back for opening a file where I want to have multiple files selected. The dialog window does allow me to select multiple files, but doesn't pass back the file names if I choose more than one (and the field is large enough as it passes the filename back correctly for one selection and only passes the path back for multiple - which is less charaters). I have the following code: ******************************************************************************8 Private Sub cmdFileOpen_Click() Dim strFiles As String ' Set the initial starting directory cdlCommon.InitDir = App.Path ' NOTE: Don't put spaces by the Pipe character! cdlCommon.Filter = "Access Databases (*.mdb)|*.mdb|" & _ "INI Files (*.ini)|*.ini|" & _ "All Files (*.*)|*.*" ' Set the flags to Multiple File Select, ' Long File Names and Explorer-Like interface cdlCommon.Flags = cdlOFNAllowMultiselect + _ cdlOFNLongNames + _ cdlOFNExplorer ' Set the maximum number of bytes ' that can be returned cdlCommon.MaxFileSize = 3000 ' Display the File Open dialog box cdlCommon.ShowOpen ' Get the path/file name selected strFiles = cdlCommon.FileName txtFileOpen.Text = strFiles End Sub *******************************************************************************8 If I choose one file, the control passes back: C:\download\paulSheriffVB6\PaulSheriff\Employees2.mdb If I choose 3 (or 2 gives me the same result), I get the following inside the control: "Employees2.mdb" "employees1.mdb" "Employees.mdb" and the following is passed back: C:\download\paulSheriffVB6\PaulSheriff Am I missing something (I'm sure I am). Thanks, Tom. - |
