Results 1 to 23 of 23

Thread: Print Listview Icons?

Threaded View

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2010
    Location
    Belgium
    Posts
    31

    Print Listview Icons?

    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?

    Code:
    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
    Dummy1912
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width