R
R. Harris
Here is what I'm trying to accomplish:
When my form loads it looks at a specific directory for a list of its files
and populates a combo box.
Dim a As New IO.DirectoryInfo("c:\dir")
Dim b As IO.FileInfo() = a.GetFiles()
Dim c As IO.FileInfo
For Each c In b
comboBox1.Items.Add(c)
Next
And that works fine. Then I want to be able to use the entries in the combo
box as string variables to use to open a file for input. The problem is that
the above code populates the combobox with object references(?) so the
comboBox2.SelectedItems doesn't work because the .selectedItems is looking
for a string value. I guess what I'm trying to ask is how can I reference
the items in my combobox as strings so I can assign them to string
variables?
I hope my question isn't confusing because I know I am.
When my form loads it looks at a specific directory for a list of its files
and populates a combo box.
Dim a As New IO.DirectoryInfo("c:\dir")
Dim b As IO.FileInfo() = a.GetFiles()
Dim c As IO.FileInfo
For Each c In b
comboBox1.Items.Add(c)
Next
And that works fine. Then I want to be able to use the entries in the combo
box as string variables to use to open a file for input. The problem is that
the above code populates the combobox with object references(?) so the
comboBox2.SelectedItems doesn't work because the .selectedItems is looking
for a string value. I guess what I'm trying to ask is how can I reference
the items in my combobox as strings so I can assign them to string
variables?
I hope my question isn't confusing because I know I am.