Exemplo n.º 1
0
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedItem != null)
            {
                Food_calculator.Substraction(listBox1.SelectedItem.ToString());

                refreshDataSource();
            }
        }
Exemplo n.º 2
0
        private void buttonOk_Click(object sender, EventArgs e)
        {
            string checkedItems = "";

            if (listBoxFruits.SelectedItem != null)
            {
                checkedItems = (string)listBoxFruits.SelectedItem;
            }
            else if (listBoxVeget.SelectedItem != null)
            {
                checkedItems = (string)listBoxVeget.SelectedItem;
            }
            Food_calculator.Additionplus(checkedItems, Convert.ToInt32(textBoxWeight.Text));

            winone.refreshDataSource();
            Close();
        }