コード例 #1
0
        /// <summary>
        /// button fot initialize the food log form
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddFood_Click(object sender, EventArgs e)
        {
            //create a new instance in memory of the food item form
            FoodItemForm food = new FoodItemForm();

            //open the food item form
            food.ShowDialog();
        }
コード例 #2
0
        /// <summary>
        /// add a new food item to the file
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnAddNewFoodItem_Click(object sender, EventArgs e)
        {
            //open the food items form and display it.
            FoodItemForm foodss = new FoodItemForm();

            foodss.ShowDialog();
            //close the form so it can reaload the new food items
            this.Close();
        }