private void addButton_Click(object sender, System.EventArgs e) { using(BlogForm newBlog = new BlogForm()) { if (newBlog.ShowDialog(this) == DialogResult.OK) { PopulateBlogList(); } } }
private void blogsList_SelectedIndexChanged(object sender, System.EventArgs e) { if (blogsList.SelectedItems.Count == 1) { Blog blog = (Blog) blogsList.SelectedItems[0].Tag; using(BlogForm newBlog = new BlogForm(blog)) { if (newBlog.ShowDialog(this) == DialogResult.OK) { PopulateBlogList(); } } } }