OpenFileDialog dlg;
richTextBox1->Text=dlg.FileNames;

Can someone tell me what am I doing wrong?
I get the following errors
cannot convert parameter 1 from 'cli::array<Type,dimension> ^' to 'System::String ^'

I want to multiselect files and then print their names intoo richTextBox1.
I know that richTextBox1>Text is System::String^ and dlg.FileNames is cli::array.
How can I make a conversion or something to get it working?

Thanks

>Can someone tell me what am I doing wrong?

OpenFileDialog^ dg=gcnew OpenFileDialog(); // Instantiate the OpenDialog
dg->ShowDialog();  
richTextBox1->Text=dg->FileName;  // Assign a file name

>Can someone tell me what am I doing wrong?

OpenFileDialog^ dg=gcnew OpenFileDialog(); // Instantiate the OpenDialog
dg->ShowDialog();  
richTextBox1->Text=dg->FileName;  // Assign a file name

Your code works fine but i don`t need a single filename
(dg->FileName). I need dg->FileNames

This question has already been answered. Start a new discussion instead.