private void OpenButton_Click(object sender, EventArgs e) { CloseFile(); DialogResult dr = TargetFile.ShowDialog(); if (dr == DialogResult.OK) { OpenFile(TargetFile.FileName); } }