I get the following error message:

Compile error:
Can't assign to read-only property

when trying to assign Multiselect to my FileListBox(File1). I used the following code:

File1.ReadOnly = False

File1.MultiSelect = 2

Do anybody know what is wrong!

best regards Kristian

Hi, I think error form the line File1.MultiSelect = 2 because MultiSelect property is read only at Runtime. that is you can set it at design time only.

Okej. I'm not kind of new i vb. What can I do to solve the problem.

Ok, one solution is to have two FileListboxes. One with Multiselect = 1 (design time). and another with MultiSelect = 2 (Designtime). When user change the property you swap the visibility of the FileListBoxes.

But it is redundant.

what do you need it for?? As far as i know i can multiselect items and do corresponding events without any issues

I just want to select and then open more then one file in the FileListBox

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.