0
Answer

Please fix this print code - error

Aaron

Aaron

18y
1.5k
1

for(int intIndex = 0; intIndex < selectedHardwareListBox.Items.Count; intIndex++)

{

strPrintLine = selectedHardwareListBox.Items[intIndex].ToString();

e.Graphics.DrawString(strPrintLine, printFont, Brushes.Black, fltPrintX, fltPrintY);

fltPrintY += fltLineHeight;

strPrintLine = ((double)priceList[intIndex]).ToString("C");

e.Graphics.DrawString(strPrintLine, printFont, Brushes.Black, fltPrintX, fltPrintY);

fltPrintY += fltLineHeight;

}

I seem to get an error when trying to print the second line.  When i take out trying to print the price in the priceList array I dont get any error, whats the deal I dont understand what the problem is. I just keep getting an error saying there is an error in print previewing the document.