private void btnBrowseCov_Click(object sender, EventArgs e) { try { OpenFileDialog dlgOpen = new OpenFileDialog(); while (dlgOpen.ShowDialog() == DialogResult.OK) { if (DiskIO.IsImageFile(dlgOpen.FileName)) { txtCover.Text = dlgOpen.FileName; break; } else { MessageBox.Show("This file is not an image file. Please Select another.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } } } catch (Exception exp) { Program.ShowExceptionData(exp); } }