public void Edit_Click(object sender, EventArgs e) { Button edit = sender as Button; string recipeName = edit.Text; Recipe wantToEdit = Form1.FindRecipe(recipeName); AddRecipeForm EditForm = new AddRecipeForm(); EditForm.ShowDialog(); EditForm.nameBox.Text = wantToEdit.Name; EditForm.timeBox.Text = wantToEdit.Time; EditForm.stepsBox.Text = wantToEdit.Steps; EditForm.ingredBox.Text = wantToEdit.Ingredients; EditForm.categBox.Text = wantToEdit.category; }
/// <summary> /// Event handler for the "add" button. /// Begins adding a new recipe /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void Add_Click(object sender, EventArgs e) { AddRecipeForm FormAdd = new AddRecipeForm(); FormAdd.ShowDialog(); }