Results 1 to 2 of 2

Thread: Print textbox values

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 1999
    Posts
    239

    Unhappy Print textbox values

    I have found out how to print to the printer using a Rich Text Box and a single text box. I would like to know if there is a way to print the contents of numerous standard textboxes (of a given form) to the printer.

  2. #2
    Addicted Member Hole-In-One's Avatar
    Join Date
    Mar 2003
    Location
    Minnesota
    Posts
    195
    This will print all textboxes on the form:


    Code:
     Private Sub printboxes(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
        For Each ctl In Me.Controls
               If TypeOf ctl Is TextBox Then
                       Dim txt As TextBox = ctl
                       e.Graphics.DrawString(txt.Text, New Font("Arial", 9, FontStyle.Bold), Brushes.Blue, txt.Left, txt.Top)
                 End If
              Next
    end sub

    Very Generic, but should give you the idea!

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