firstdivision
MIS
Hi,
When using the common dialog control found on:
Shouldn't the common dialog return the filename and the extension when ShowSave is called? Or am I just doing something stupid here...
Here's the code I use when calling:
The filter works properly, changing the dropdown in the save dialog changes the list of files, but if I enter a filename with no extension, then click save, the FileName property contains the path and "filename", but no extension. This isn't how I remember the Common Dialog from VB6 working. Or am I having a Brain Fart.
I guess I can get at the FilterIndex property and find out what extension was chosen...
Thanks,
Andrew
When using the common dialog control found on:
Shouldn't the common dialog return the filename and the extension when ShowSave is called? Or am I just doing something stupid here...
Here's the code I use when calling:
Code:
Dim cdl As New clsCommonDialog
Dim strFileName As String 'full file name
cdl.Filter = "Text Files (*.txt)|*.txt|Batch Files (*.bat)|*.bat"
'this is where the dialog opens
cdl.ShowSave
strFileName = cdl.FileName
'hence no len, no name...
If Len(strFileName) = 0 Then Exit Sub
MsgBox (strFileName)
The filter works properly, changing the dropdown in the save dialog changes the list of files, but if I enter a filename with no extension, then click save, the FileName property contains the path and "filename", but no extension. This isn't how I remember the Common Dialog from VB6 working. Or am I having a Brain Fart.
I guess I can get at the FilterIndex property and find out what extension was chosen...
Thanks,
Andrew