Question adding mutliple items

theatheist77

Member
Joined
Dec 1, 2011
Messages
10
Programming Experience
Beginner
hi everybody!

first of all, i am new to this forum.

so i got a openfiledialog and a listbox.
if i want to add one i tem to the listbox from the openfile dialog it works.
but whenever i try to do it with multiple files it says: string[] array

codes:

openfiledialog1 button

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

OpenFileDialog1.ShowDialog()


ListBox1.Items.Add(OpenFileDialog1.FileNames)


EndSub



multiple file select is true.
can someone help me out?
 
You want to add a range of items, rather than add one item, right?
 
Well, using AddRange instead of Add should be pretty obvious by now, don't you think? You have posted two lines of code where one of them uses Add, and I say that you should use AddRange in place.
 
Well, using AddRange instead of Add should be pretty obvious by now, don't you think? You have posted two lines of code where one of them uses Add, and I say that you should use AddRange in place.

oh yeah, sorry that i didn't understand it at first.

but again, thx.
 
Back
Top