title: Display data from listBox into receipt using messagebox(or any other methods) in c#
body: <p>Hey guys this is my code for getting items from users and to calculate the total payment using C#. My problem is how do i do the Receipt part? I'm stuck. I don't know whether to use messagebox or use datagrid in another form. But I don't know how to use that. C# newbie here. Saw some tutorial in youtube to get this. </p>
  
  <p>Thanks</p>
  
  <pre><code>    private void getValues(string custOrder)
      {
          order.item = custOrder.Split('$')[0];   
          order.price = Convert.ToDouble(custOrder.Split('$')[1]);    
          finalBill += "Ordered Item: " + order.item + "\nPrice: " + order.price.ToString("C2") + "\n";   //C2 for 2 Decimal places
          updateBill();       
      }
  
      private void updateBill()
      {
          subtotal += order.price;
          total += order.price + (order.price * TAX);
          totalTaxes += order.price * TAX;
  
          listBox1.Items.Clear();     Only output latest bills
          listBox1.Items.AddRange(finalBill.Split('\n'));  
          listBox1.Items.Add("Subtotal: " + subtotal.ToString("C2"));
          listBox1.Items.Add("Tax: " + totalTaxes.ToString("C2"));
          listBox1.Items.Add("Total: " + total.ToString("C2"));
      }
  
  
      private void boxSelection(object sender, EventArgs e)   
      {
          {
              if (sender == meals)
                  getValues(meals.SelectedItem.ToString());
              else if (sender == sideorders)
                  getValues(sideorders.SelectedItem.ToString());
              else
                  getValues(drinks.SelectedItem.ToString());
          }
  
      }
  
  
  
      private void ResetButton_Click(object sender, EventArgs e)
      {
          subtotal = 0;
          total = 0;
          totalTaxes = 0;
          finalBill = "FINAL BILL : \n";
          listBox1.Items.Clear();
      }
  
      private void print_receipt_Click(object sender, EventArgs e)
      {
  
  
  
      }
  </code></pre>