I need to select multiple files from the browse button. Right now, my code only selects one file. I need to select multiple files (by pressing control on Windows or command on Mac) and process them individually.I want a file per each line in my textbox.
Asked
Active
Viewed 357 times
-2
-
[Microsoft's OpenFileDialog documentation](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.openfiledialog.multiselect?view=netframework-4.8#System_Windows_Forms_OpenFileDialog_Multiselect) has a pretty solid example of doing exactly that. – Diado Jan 20 '20 at 14:46
-
2Sometimes it's worth just having a quick flick through the docs for the control in question. In this case, there are only 6 properties, one of which is [`Multiselect`](https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.openfiledialog.multiselect?view=netframework-4.8) – canton7 Jan 20 '20 at 14:46
-
2Does this answer your question? [Opening multiple files (OpenFileDialog, C#)](https://stackoverflow.com/questions/1311578/opening-multiple-files-openfiledialog-c) – urbz Jan 20 '20 at 14:49
1 Answers
0
OpenFileDialog has a Multiselect property.
Add this into your code(before showing the dialog).
fd.Multiselect = true;

Burak Yeniçeri
- 91
- 2
- 15