Printing from multiple listboxes
<p>I have this code below that prints from 4 different list-boxes but does not print the information that's in the list-boxes but i can view the information that I need to print in print preview but does not show up when I print. But nothing prints....</p>

<p>Thanks in advance.             </p>

<pre><code>    private void btnPrint_Click(object sender, EventArgs e)
    {
        printDocument1.OriginAtMargins = true;
        printDocument1.DocumentName = "Barcode";
        printPreviewDialog1.Document = printDocument1;

        string itemcode = "";
        string itemDescription = "";
        string inclValue = "";
        string exclValue = "";

        foreach (object x in lstbxItemCode.Items)
        {
            itemcode = itemcode + x + "\n";
        }
        foreach (object y in lstbxItemDesc.Items)
        {
            itemDescription = itemDescription + y + "\n";
        }
        foreach (object z in lstbxInclValue.Items)
        {
            inclValue = inclValue + z + "\n";
        }
        foreach (object y in lstbxExclValue.Items)
        {
            exclValue = exclValue + y + "\n";
        }
        myReader = new StringReader("ItemCode: " + itemcode + "\n" + "ItemDescription: " + itemDescription + "\n" + "InclValue: " +"R " + inclValue + "\n" + "ExclValue: " +"R " + exclValue);
        printPreviewDialog1.Show();
    }

    private void printDocument1_PrintPage(object sender, PrintPageEventArgs ev)
    {


        int count = 0;
        float leftMargin = ev.MarginBounds.Left;
        float topMargin = ev.MarginBounds.Top;
        string line = null;
        Font printFont = lstbxItemCode.Font;
        using (var myBrush = new SolidBrush(Color.Black))
        {
            float linesPerPage = ev.MarginBounds.Height/printFont.GetHeight(ev.Graphics);

            // Iterate over the string using the StringReader, printing each line.
            while (count &lt; linesPerPage &amp;&amp; ((line = myReader.ReadLine()) != null))
            {
                // calculate the next line position based on
                // the height of the font according to the printing device
                float yPosition = topMargin + (count * printFont.GetHeight(ev.Graphics));

                // draw the next line in the rich edit control

                ev.Graphics.DrawString(line, printFont,
                                       myBrush, leftMargin,
                                       yPosition, new StringFormat());
                count++;
            }
        }
</code></pre>

<p>}</p>
