Open File Dialog problem

E

Elmo Watson

I have a combobox, listing file extensions (JPG, BMP, etc)

in my OpenFileDialog, I have:
Const sFilters As String = "JPG (*.jpg)|*.jpg|GIF (*.gif)|*.gif|BMP
(*.bmp)|*.bmp|PNG (*.png)|*.png|TIF (*.tif)|*.tif|Wmf (*.wmf)|*.wmf"

Dim ofd As New OpenFileDialog
ofd.DefaultExt = ComboBox1.Text.ToLower
ofd.Filter = sFilters
ofd.Title = "Open Image File"
If ofd.ShowDialog = Windows.Forms.DialogResult.OK Then
.....etc

No matter what I change ComboBox1's filter to, the OpenFileDialog never
selects it in the list of Filters - it just comes up with the first file
listed in 'sFilters'

What am I missing here?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top