private void ViewDialog_VisibleChanged(object sender, EventArgs e) { var tb = (Form)sender; if (tb.Visible) { _viewDialog.BringToFront(); _viewDialog.Location = new Point(Cursor.Position.X - 20, Cursor.Position.Y - 70); _viewDialog.UserInput.Text = ""; } _viewDialog.UserInput.Focus(); }
private void DataFilesUserHasAdded() { var index = 0; foreach (var settingsFile in _settings.AdvancedFiles) { if (!File.Exists(settingsFile)) { var r = Screen.PrimaryScreen.Bounds; _dialog.Location = new Point(r.Right / 2, r.Bottom / 2); _dialog.BringToFront(); _dialog.SetText(AddFileToInfoText(settingsFile)); _dialog.UserInput.Hide(); _settings.AdvancedFiles.RemoveAt(index); DataFilesUserHasAdded(); // can't continue iterating foreach when item removed. _dialog.Show(); _settings.Save(); return; } index++; } }