davidtrina
asked on
Custom Open File Dialog in .NET to open a directory as a file
I am programming this in VB.NET 2005, Is there a way to use the open file dialog box to open a folder like a file? Meaning, I am using a product that stores its databases in a directory with an extension example: MyDB.gdb, so if I use OpenFileDialog, it opens it like it would any other Directory I need to be able to tell it that .gdb is a file and when they click open it selects it like it would a File and return back a path to the "file"
ASKER
Ok... the .GDB "file" is in fact NOT a file it is a directory that I want to treat like a file
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
With ofd
.InitialDirectory = "C:\"
.Title = "Select a database"
.FileName = ""
.Filter = "Database (*.gdb)|*.gdb
.FilterIndex = 1
End With
If ofd.ShowDialog <> System.Windows.Forms.Dialo
Dim strMyPath as String = ofd.FileName
'Then whatever else you want to do...
End If