• 0

[VB.NET] FileDialog - All Formats Filter


Question

How can I set a filedialog's filter property to select "All Formats". Not All Files, but All Formats, whereby I specify which formats are valid. Example: In my program, the filedialog can open jpg, bmp, gif, and png files. So how would I add a filter named "All Formats" for those four file types?

Link to comment
https://www.neowin.net/forum/topic/585184-vbnet-filedialog-all-formats-filter/
Share on other sites

2 answers to this question

Recommended Posts

  • 0

		Dim openFileDialog As New OpenFileDialog()
		With openFileDialog
			.Filter = "All Formats (*.BMP,*.PNG,*.JPEG*.GIF)|*.jpeg;*.jpg;*.bmp;*.png;*.gif"
			If .ShowDialog() = Windows.Forms.DialogResult.OK Then
				MessageBox.Show("Selected " + .FileName)
			End If
		End With

Hope that helps.

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.