title: How can I get my checked items in listbox and print to my receipt form C#
body: <p>I want to get my checkitems to listbox and display in my receipt print preview but it didn't read it and when I declare the checklistboxitems1 the only show in my print preview is the only last I checked. Please help me guys thank you so much </p>
  
  <p><a href="https://i.stack.imgur.com/RC8Oz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/RC8Oz.png" alt="enter image description here"></a></p>
  
  <p>Here's my code of cashier form</p>
  
  <pre><code>namespace Barangay_System
  {
      public partial class Cashier1 : Form
      {
          public Cashier1()
          {
              InitializeComponent();
          }
  
          private void checkedListBox1_SelectedIndexChanged(object sender, EventArgs e)
          {
              int sum = 0;
  
              listBox1.Items.Clear();
              listBox2.Items.Clear();
              label2.Text="";
  
              foreach (string s in checkedListBox1.CheckedItems)
                  listBox1.Items.Add(s);
  
              foreach (int i in checkedListBox1.CheckedIndices)
              {
                  if (i == 0)
                  {
                      listBox2.Items.Add(300);
                      sum += 300;
                  }
  
                  if (i == 1)
                  {
                      listBox2.Items.Add(100);
                      sum += 100;
                  }
  
                  if (i == 2)
                  {
                      listBox2.Items.Add(200);
                      sum += 200;
                  }
  
                  label2.Text = sum.ToString();
              }
          }
  
          private void button1_Click(object sender, EventArgs e)
          {
              printPreviewDialog1.Document = printDocument1;
              printPreviewDialog1.ShowDialog();
          }
  
          private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
          {
              Bitmap bmp = Properties.Resources.Resibo;
              Image newImage = bmp;
              e.Graphics.DrawImage(newImage, 35, 35, newImage.Width, newImage.Height);
              e.Graphics.DrawString("  Name :                     " + label3.Text, new Font("Arial", 18, FontStyle.Regular), Brushes.Black, new Point(30, 150));
              e.Graphics.DrawString("  Requested :                " + listBox1.Items.ToString(), new Font("Arial", 18, FontStyle.Regular), Brushes.Black, new Point(30, 200));
              e.Graphics.DrawString("  Total :                    " + label2.Text, new Font("Arial", 18, FontStyle.Regular), Brushes.Black, new Point(30, 250));
          }
      }
  }
  </code></pre>