I use this code to open a FileDialog, choose a file and press OK.
It works fine, but when I press OK in the fileDialog, the FileDialog doesn´t close after pressing OK the first time. The dialog blinks one time and are still open.
The second time I press OK, the openfileDialog will close.
What can I do to make it close when I press OK the first time ?
openFileDialog1->ShowDialog();
if (openFileDialog1->ShowDialog() == System::Windows::Forms::DialogResult::OK)
{
textBox5->Text = openFileDialog1->FileName;
}