private void OpenFile_Click(object sender, EventArgs e) { var filePath = string.Empty; using OpenFileDialog openFileDialog = new OpenFileDialog(); openFileDialog.InitialDirectory = "c:\\"; openFileDialog.Filter = "Таблицы Excel (*.xls *.xlsx)|*.xls; *xlsx|Текстовый файл (*.txt)|*.txt"; openFileDialog.FilterIndex = 0; openFileDialog.RestoreDirectory = true; if (openFileDialog.ShowDialog() == DialogResult.OK) { Hide(); FileReadPlaceholder ChooseModeForm = new FileReadPlaceholder(openFileDialog.FileName); ChooseModeForm.Closed += (s, args) => { TimerSettings.ResetCompetition(); /* Может убрать в др место? */ Show(); }; ChooseModeForm.Show(); } }