How to add the text from a textbox into the printdocument

I am trying to take the text from a TextBox or label and put it into the PrintDocument so that I can use PrintPreview.
[118 byte] By [TheQuietShadow] at [2007-12-24]
# 1

you pretty much would have to draw it.

Take a look at the docs:

http://msdn2.microsoft.com/en-us/library/system.drawing.printing.printdocument.aspx

pretty much instead of "line" when reading from a file, its just to your textbox's text property

ahmedilyas at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...
# 2

Keep in mind, the name 'printdocument' confuses a lot of people.

'PrintDocument' is not what is printed. A printdocument is a collection of printer

settings. 'PrintDocument' does have an event associated with it

called 'PrintPage'.

The 'PrintDocument.PrintPage' event handler is a sub that is called

when PrintDocument.Print() is called or when a PrintPreviewDialog.ShowDialog

with it's 'document' set to a printdocument is called.

(Example print preview calls the PrintDocument.PrintPage event:

PrintPreviewDialog1.Document = PrintDocument1

PrintPreviewDialog1.ShowDialog()

)

See example at http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=688276&SiteID=1

The stuff to be printed or print previewed is drawn in the PrintDocument1_PrintPage sub.

TallDude at 2007-8-31 > top of Msdn Tech,Visual Studio Express Editions,Visual Basic 2005 Express Edition...