[img]https://social.msdn.microsoft.com/Forums/getfile/1011324[/img]

How can I fix this error on this page?

my code; [code] private void btnPrint_Click(object _sender, EventArgs args) { PrintPreviewDialog ppd = new PrintPreviewDialog(); ppd.Document = printdocument; ppd.ClientSize = new Size(900, 600); ppd.ShowIcon = true; ppd.Icon = new Icon(Assembly.GetEntryAssembly().GetManifestResourceStream("Konak.Desktop.Images.SBCM.ICO")); ppd.StartPosition = FormStartPosition.CenterScreen; ppd.Document.DocumentName = "Transfer Islem Bilgileri"; this.printdocument.PrintPage += (s, a) => { printdocument_PrintPage(s, a); }; ppd.ShowDialog(); } private void printdocument_PrintPage(object S, PrintPageEventArgs a) { float leftMargin = a.MarginBounds.Left; float topMargin = a.MarginBounds.Top; int count = 0; List<string> lst = new List<string>(); for (int i = 0; i < listboxInfoList.Items.Count; i++) { a.Graphics.DrawString(listboxInfoList.Items[i].ToString(), this.Font, Brushes.Black, leftMargin, topMargin + count * this.Font.GetHeight(a.Graphics), new StringFormat()); lst.Add(listboxInfoList.Items[i].ToString()); count++; } if (!(count >= lst.Count - 1)) { a.HasMorePages = true; } else { a.HasMorePages = false; } }[/code]"> [img]https://social.msdn.microsoft.com/Forums/getfile/1011324[/img]

How can I fix this error on this page?

my code; [code] private void btnPrint_Click(object _sender, EventArgs args) { PrintPreviewDialog ppd = new PrintPreviewDialog(); ppd.Document = printdocument; ppd.ClientSize = new Size(900, 600); ppd.ShowIcon = true; ppd.Icon = new Icon(Assembly.GetEntryAssembly().GetManifestResourceStream("Konak.Desktop.Images.SBCM.ICO")); ppd.StartPosition = FormStartPosition.CenterScreen; ppd.Document.DocumentName = "Transfer Islem Bilgileri"; this.printdocument.PrintPage += (s, a) => { printdocument_PrintPage(s, a); }; ppd.ShowDialog(); } private void printdocument_PrintPage(object S, PrintPageEventArgs a) { float leftMargin = a.MarginBounds.Left; float topMargin = a.MarginBounds.Top; int count = 0; List<string> lst = new List<string>(); for (int i = 0; i < listboxInfoList.Items.Count; i++) { a.Graphics.DrawString(listboxInfoList.Items[i].ToString(), this.Font, Brushes.Black, leftMargin, topMargin + count * this.Font.GetHeight(a.Graphics), new StringFormat()); lst.Add(listboxInfoList.Items[i].ToString()); count++; } if (!(count >= lst.Count - 1)) { a.HasMorePages = true; } else { a.HasMorePages = false; } }[/code]"> [img]https://social.msdn.microsoft.com/Forums/getfile/1011324[/img]

How can I fix this error on this page?

my code; [code] private void btnPrint_Click(object _sender, EventArgs args) { PrintPreviewDialog ppd = new PrintPreviewDialog(); ppd.Document = printdocument; ppd.ClientSize = new Size(900, 600); ppd.ShowIcon = true; ppd.Icon = new Icon(Assembly.GetEntryAssembly().GetManifestResourceStream("Konak.Desktop.Images.SBCM.ICO")); ppd.StartPosition = FormStartPosition.CenterScreen; ppd.Document.DocumentName = "Transfer Islem Bilgileri"; this.printdocument.PrintPage += (s, a) => { printdocument_PrintPage(s, a); }; ppd.ShowDialog(); } private void printdocument_PrintPage(object S, PrintPageEventArgs a) { float leftMargin = a.MarginBounds.Left; float topMargin = a.MarginBounds.Top; int count = 0; List<string> lst = new List<string>(); for (int i = 0; i < listboxInfoList.Items.Count; i++) { a.Graphics.DrawString(listboxInfoList.Items[i].ToString(), this.Font, Brushes.Black, leftMargin, topMargin + count * this.Font.GetHeight(a.Graphics), new StringFormat()); lst.Add(listboxInfoList.Items[i].ToString()); count++; } if (!(count >= lst.Count - 1)) { a.HasMorePages = true; } else { a.HasMorePages = false; } }[/code]">
On the following page,

[img]https://social.msdn.microsoft.com/Forums/getfile/1011324[/img]

How can I fix this error on this page?

my code; [code] private void btnPrint_Click(object _sender, EventArgs args) { PrintPreviewDialog ppd = new PrintPreviewDialog(); ppd.Document = printdocument; ppd.ClientSize = new Size(900, 600); ppd.ShowIcon = true; ppd.Icon = new Icon(Assembly.GetEntryAssembly().GetManifestResourceStream("Konak.Desktop.Images.SBCM.ICO")); ppd.StartPosition = FormStartPosition.CenterScreen; ppd.Document.DocumentName = "Transfer Islem Bilgileri"; this.printdocument.PrintPage += (s, a) => { printdocument_PrintPage(s, a); }; ppd.ShowDialog(); } private void printdocument_PrintPage(object S, PrintPageEventArgs a) { float leftMargin = a.MarginBounds.Left; float topMargin = a.MarginBounds.Top; int count = 0; List<string> lst = new List<string>(); for (int i = 0; i < listboxInfoList.Items.Count; i++) { a.Graphics.DrawString(listboxInfoList.Items[i].ToString(), this.Font, Brushes.Black, leftMargin, topMargin + count * this.Font.GetHeight(a.Graphics), new StringFormat()); lst.Add(listboxInfoList.Items[i].ToString()); count++; } if (!(count >= lst.Count - 1)) { a.HasMorePages = true; } else { a.HasMorePages = false; } }[/code]


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir