how can I print the contents of a text/richtextbox to a printer hardware? tnx!
In a nutshell it's as simple as: Code: Printer.Print Text1.Text Printer.EndDoc However, line wrapping, new pages, etc will need to be calculated. I believe we have samples of advanced printing posted so try to search.
Printer.Print Text1.Text Printer.EndDoc
Microsoft MVP - Visual Basic 2006-2013 Why VB clears the clipboard on startup and how to avoid it? . Filtering Arrays . Save File To Database . Extract File From Database . Extract picture from database without using hard drive . Change Menu BackColor . How to use MS Flexgrid . Make Frame Transparent . The Easiest Way to Create an NT Service With VB6 . How to comment blocks of code in VB5 and VB6 . How to find and replace missing members of control array Visual Basic 6.0 On-Line Documentation . Connection Strings
Thank you very much for the quick help.. its very appreciated..
Or, for the richtextbox you can use a simple one liner Code: Call RichTextBox1.SelPrint(Printer.hdc) For a standard textbox, you would need to use RhinoBull's code.
Call RichTextBox1.SelPrint(Printer.hdc)
Forum Rules