Hello,
someone who can help me please
I have a code for a listview printing
but the problem is that he don't print the icons.
And this I never have to test until now
I can add anything like a color and other stuff but I do not know how to solved this.
please anyone?
Dummy1912Code:Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage 'Headings currentY = 100 For Each c In lstView.Columns maxY = Math.Max(maxY, g.MeasureString(c.Text, f, c.Width).Height) colLefts(idx) = l colWidths(idx) = c.Width lr = New RectangleF(colLefts(idx), currentY, colWidths(idx), maxY) If lr.Width > 0 Then g.DrawString(c.Text, f, b, lr) l += c.Width idx += 1 Next currentY += maxY + gap g.DrawLine(Pens.Black, 0, currentY, e.PageBounds.Width, currentY) currentY += gap 'Rows iCount = lstView.Items.Count - 1 l = 0 maxY = 0 idx = 0 For Each lvsi In lstView.Items(ii).SubItems maxY = Math.Max(maxY, g.MeasureString(lvsi.Text, f, colWidths(idx)).Height) lr = New RectangleF(colLefts(idx), currentY, colWidths(idx), maxY) If lr.Width > 0 Then g.DrawString(lvsi.Text, f, b, lr) idx += 1 Next currentY += maxY + gap Next




Reply With Quote