How to make a OpenFileDialog1 object return multiple paths of the selected files to a multi-line textbox?
I've created some code for you to use:
private void SomeMethod()
{
string[] lines = GetFileNames();
if (lines != null)
textBox1.Lines = lines;
}
private string[] GetFileNames()
{
var dialog = new OpenFileDialog()
{
Multiselect = true
};
if (dialog.ShowDialog() == DialogResult.OK)
return dialog.FileNames;
else
return null;
}
I hope it helps.