private void createNewCategoryButton_Click(object sender, EventArgs e) { var category = new ItemCategory { Name = "New Category" }; DatabaseConnector.AddCategory(category); ResetForm(); WireUpList(); int lastIndex = categoriesListBox.Items.Count - 1; categoriesListBox.SelectedItem = categoriesListBox.Items[lastIndex]; }