Hello
How can I make it so my commondialog control can select multiple files in the showopen window?
Thanks SgtSlayer
Printable View
Hello
How can I make it so my commondialog control can select multiple files in the showopen window?
Thanks SgtSlayer
CommonDialog1.Flags = cdlOFNAllowMultiselect
You need to use this other flag if you want Long Filename support.
VB Code:
CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames
That Rocks! Is there any way I can change the interface for that thou?
Thanks
SgtSlayer
I'm not sure what you mean, but here's the routine that I use:
VB Code:
Private Sub cmdOpen_Click() ' CancelError is True. On Error GoTo ErrHandler ' Set Flags CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames ' Set filters. CommonDialog1.Filter = "All Files (*.*)|*.*|Text" & _ "Files (*.txt)|*.txt|Batch Files (*.bat)|*.bat" ' Specify default filter. CommonDialog1.FilterIndex = 2 ' Picks TEXT as default ' Display the Open dialog box. CommonDialog1.ShowOpen ' Call the open file procedure. ' OpenFile (CommonDialog1.FileName) Exit Sub ErrHandler: ' User pressed Cancel button. Exit Sub End Sub
Filename returns this, you'd have to split() on the space between names.
Quote:
D:\VISUAL~2\C\CDCSHO~1\ CDCSHO~1.ZIP form1.frm form1.frx Project1.vbp Project1.vbw
There are two basic interfaces to the ShowOpen method. The one shown depends on the inclusion of the cdlOFNExplorer flag.Quote:
Is there any way I can change the interface for that thou?
CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNLongNames Or cdlOFNExplorer
There are other flags that let you manipulate the interface
cdlOFNHelpButton - adds a Help button
cdlOFNHideReadOnly - hide the "Open as ReadOnly" checkbox.
Ok Thanks! :thumb:
Thanks
SgtSlayer