Math problems/ operands from listbox

I need a code that would take numbers from a list box and solve them when i press add or multiply I have been working on this for hours and can't get it right......please help.
progbeginnerAsked:
Who is Participating?
 
RabmisConnect With a Mentor Commented:
As I understand It's should be like that
        private void buttonPlus_Click(object sender, EventArgs e)
        {
            Int32 sum = 0;
            foreach (string s in listBox1.Items)
            {
                Int32 value;
                if (Int32.TryParse(s, out value))
                    sum += value;
            }
            MessageBox.Show(sum.ToString());
        }

Open in new window

0
 
mlmccCommented:
What code do you have thus far?

mlmcc
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.