Results 1 to 2 of 2

Thread: Print List Box

  1. #1

    Thread Starter
    Addicted Member Stick's Avatar
    Join Date
    Aug 1999
    Location
    Iowa
    Posts
    152

    Print List Box

    How can i simply print a list box.
    ANY EASY way works!

    ThANKS

  2. #2

    Thread Starter
    Addicted Member Stick's Avatar
    Join Date
    Aug 1999
    Location
    Iowa
    Posts
    152

    well here it is incase someone ever needs it

    Code:
    Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
            prnList.Print()
        End Sub
    
        Private Sub prnList_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles prnList.PrintPage
            Dim intlistindex As Integer
            Dim strprintline As String
            Dim fntprintfont As New Font("Arial", 12)
            Dim snglineheight As Single = fntprintfont.GetHeight + 2
            Dim sngprintx As Single
            Dim sngprinty As Single
            sngprintx = e.MarginBounds.Left
            sngprinty = e.MarginBounds.Top
    
            For intlistindex = 0 To lstTotal.Items.Count - 1
                strprintline = CStr(lstTotal.Items(intlistindex))
                e.Graphics.DrawString(strprintline, fntprintfont, Brushes.Black, sngprintx, sngprinty)
                sngprinty += snglineheight
    
            Next
        End Sub

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