private void button1_Click(object sender, EventArgs e) { try { OpenFileDialog dlgBrowse = new OpenFileDialog(); while (dlgBrowse.ShowDialog() == DialogResult.OK) { if (DiskIO.IsVideoFile(dlgBrowse.FileName)) { txtTrailerFie.Text = dlgBrowse.FileName; break; } else { MessageBox.Show("This file is not a valid video file. Please Select another.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } catch (Exception exp) { Program.ShowExceptionData(exp); } }