B
Brian P. Hammer
All,
I have an open file dialog on one of my forms. Everything works great except the filter. I am trying to hide all files that do not have an extension of cap but any file extension shows up. Any ideas with the code below?
Dim myOpenFileDialog As New OpenFileDialog()
Try
With myOpenFileDialog
.CheckFileExists = True
.CheckPathExists = True
.DefaultExt = "cap"
.DereferenceLinks = True
.InitialDirectory = DocsPath & "\CACE"
.Filter = "CACE files (*.cap)|"
.Multiselect = False
.RestoreDirectory = True
.ShowHelp = True
.ShowReadOnly = False
.Title = "Select a CACE file to open"
.ValidateNames = True
If .ShowDialog() = DialogResult.OK Then
FileName = .FileName
dsAircraft = ReadInData()
PopulateTree()
BindData()
ShowMenus(True)
Me.mnuSave.Enabled = False
Me.tbSave.Enabled = False
Me.tmrDirty.Interval = 500
Me.tmrDirty.Enabled = True
MakeRecordDirty(False)
HasLoaded = True
PerformCalculations()
LoadChartData()
Else
Exit Sub
End If
End With
I have an open file dialog on one of my forms. Everything works great except the filter. I am trying to hide all files that do not have an extension of cap but any file extension shows up. Any ideas with the code below?
Dim myOpenFileDialog As New OpenFileDialog()
Try
With myOpenFileDialog
.CheckFileExists = True
.CheckPathExists = True
.DefaultExt = "cap"
.DereferenceLinks = True
.InitialDirectory = DocsPath & "\CACE"
.Filter = "CACE files (*.cap)|"
.Multiselect = False
.RestoreDirectory = True
.ShowHelp = True
.ShowReadOnly = False
.Title = "Select a CACE file to open"
.ValidateNames = True
If .ShowDialog() = DialogResult.OK Then
FileName = .FileName
dsAircraft = ReadInData()
PopulateTree()
BindData()
ShowMenus(True)
Me.mnuSave.Enabled = False
Me.tbSave.Enabled = False
Me.tmrDirty.Interval = 500
Me.tmrDirty.Enabled = True
MakeRecordDirty(False)
HasLoaded = True
PerformCalculations()
LoadChartData()
Else
Exit Sub
End If
End With