private void deletePostSubmitButton_Click(object sender, EventArgs e) { if (postsTooDelete.SelectedIndex == -1) { MessageBox.Show("Please select an Item first!"); } else { MessageBox.Show("Post removed."); MySQLFunctions.deletePost(email, postsTooDelete.Text); this.Hide(); AddProfileImage a = new AddProfileImage(2, email); this.Close(); } }