How do I filter file types in open - save file dialog with these types? I want to list all files EXCLUDING *JAR and *JAVA example I found on google:
Using O As New OpenFileDialog With {.Filter = "(Image Files)|*.jpg;*.png;*.bmp;*.gif;*.ico|Jpg, | *.jpg|Png, | *.png|Bmp, | *.bmp|Gif, | *.gif|Ico | *.ico", .Multiselect = False, .Title = "Select Image"}
If O.ShowDialog = 1 Then
TextBox1.Text = O.FileName
End If
End Using
hi you can try this code.
openFD.InitialDirectory = "C:\"
openFD.Title = "Open a Text File"
openFD.Filter = "Text Files|*.txt"
openFD.ShowDialog()
feel free to contact if get problem.
Regards.
There no excluding option in those filters. You might add code later not to process something if its file type ends with xxxxx (whatver you want to exclude).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With