private void OnMovieEdit(object sender, EventArgs e) { var item = _listMovies.SelectedItem as Movie; if (item == null) { return; } var form = new MovieForm(); form.Movie = item; if (form.ShowDialog(this) == DialogResult.Cancel) { return; } //MessageBox.Show("Adding movie"); _database.Edit(item.Name, form.Movie); // Movie.Name = ""; RefreshMovies(); }