How to have open dialog with only vb.net sln files

RIAS
RIAS used Ask the Experts™
on
Hi,
How to have a dialog box with only vb.net sln files as filter.

Cheers
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Here is a good example
http://msdn.microsoft.com/en-us/library/system.windows.forms.filedialog.filter.aspx

Specificially you need:

        Dim openFileDialog1 As New OpenFileDialog()

        openFileDialog1.InitialDirectory = "c:\"
        openFileDialog1.Filter = "Solution files (*.sln)|*.txt|All files (*.*)|*.*"

        dim result as System.Windows.Forms.DialogResult
        result = openFileDialog1.ShowDialog
Sorry typo in previous pos:  

Specificially you need:

        Dim openFileDialog1 As New OpenFileDialog()

        openFileDialog1.InitialDirectory = "c:\"
        openFileDialog1.Filter = "Solution files (*.sln)|*.sln|All files (*.*)|*.*"

        dim result as System.Windows.Forms.DialogResult
        result = openFileDialog1.ShowDialog
Dirk HaestProject manager
Commented:
With SaveFileDialog1
.Filter = "Solution files (*.sln)|*.sln"
If .ShowDialog() = DialogResult.OK

Author

Commented:
Cheers mate

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial