title: WinForm C# list box ,click button ,txt box. sum of items
body: <p>Hi I'm trying to create a program that gives the user a list box full of items and their respective prices. When the user selects an item and clicks the add to order button it will add the item to a order summary listbox and also add the price of that item to a subtotal textbox. I have it almost fully functional but my problem is that I can't get the subtotal to add up. What I mean is when I add one item to the summary list box it displays the price in the subtotal textbox but when I add a second item to the summary list box it doesn't add to the previous price in the subtotal text box instead it just replaces the price of the first item with the price of the second item. How can I get them to add up and display them in the subtotal text box?</p>
  
  <p>Here's how my code looks now under a btn click event handler:</p>
  
  <p>double subTotal = 0.00;</p>
  
  <pre><code>if (lstBoxItemSelection.Text =="Item 1 = 1.00")
      { 
           LstBoxSummary.Items.Add("Item 1 = 1.00")
           subTotal += 1.00;
       }
  
  if (lstBoxItemSelection.Text =="Item 2 = 2.00"  )
       { 
           LstBoxSummary.Items.Add("Item 2 = 2.00")
           subTotal += 2.00;
       }
  
  this.txtBoxSubTotal.Text = subtotal.ToString();
  </code></pre>
  
  <p>Thanks for any help!</p>