|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Printing the contents of a textboxIn VB i had some very very simple code that would print out the contents of a
textbox for me. It was simply Sub PrintTB() Printer.Print(Text1.Text) End sub Very simple, and 110% effective. How the hell do i do this in VB .Net???
Show quote
Hide quote
"Jonathan Smith" <JonathanSm***@discussions.microsoft.com> schrieb: That's not as easy. You will have to use the 'PrintDocument' object and > In VB i had some very very simple code that would print out the contents > of a > textbox for me. > > It was simply > > Sub PrintTB() > Printer.Print(Text1.Text) > End sub > > Very simple, and 110% effective. > > How the hell do i do this in VB .Net??? draw the string onto the printer using 'e.Graphics.ToString' in the 'PrintDocument''s 'PrintPage' event handler. 'PrintDocument' won't to paging automatically, so you'll have to measure the text you are printing and start a new page using 'e.HasMorePages' manually, which will cause 'PrintPage' to be called one more time for the next page. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> Are you serious????
All i want to do is print the contents of a textbox Show quoteHide quote "Herfried K. Wagner [MVP]" wrote: > "Jonathan Smith" <JonathanSm***@discussions.microsoft.com> schrieb: > > In VB i had some very very simple code that would print out the contents > > of a > > textbox for me. > > > > It was simply > > > > Sub PrintTB() > > Printer.Print(Text1.Text) > > End sub > > > > Very simple, and 110% effective. > > > > How the hell do i do this in VB .Net??? > > That's not as easy. You will have to use the 'PrintDocument' object and > draw the string onto the printer using 'e.Graphics.ToString' in the > 'PrintDocument''s 'PrintPage' event handler. 'PrintDocument' won't to > paging automatically, so you'll have to measure the text you are printing > and start a new page using 'e.HasMorePages' manually, which will cause > 'PrintPage' to be called one more time for the next page. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> > > "Jonathan Smith" <JonathanSm***@discussions.microsoft.com> schrieb: Yes, I am.> Are you serious???? -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> "Jonathan Smith" <JonathanSm***@discussions.microsoft.com> wrote in message There's a really good run down of how do this in "Visual Basic 2005 Express news:D788E7CB-19EE-4834-8C08-E29E5160E2E0@microsoft.com... > Are you serious???? > > All i want to do is print the contents of a textbox Edition for Dummies 2005", CHAPTER 9 Hint: http://www.dummies.com/WileyCDA/DummiesTitle/productCd-0764597051,page-1.html Jonathan,
The .Net framework includes classes that allow you to build sophisticated print capabilities into an app. But something as simple as the VB6 Printer object is not included. You can google for .Net printing and find several third-party tools that attempt to give you capabilities similar to the VB6 Printer object. I have not tried these tools so I can't recommend any of them. Kerry Moorman Show quoteHide quote "Jonathan Smith" wrote: > In VB i had some very very simple code that would print out the contents of a > textbox for me. > > It was simply > > Sub PrintTB() > Printer.Print(Text1.Text) > End sub > > Very simple, and 110% effective. > > How the hell do i do this in VB .Net??? That won't print to the printer like he wishes to do.
james Show quoteHide quote "Aziz" <aziz***@googlemail.com> wrote in message news:1144167373.141778.8610@u72g2000cwu.googlegroups.com... > perhaps this is what you mean? > > Debug.Writeline("Hello") >
How to retrive Outlook 2003 style gradient color schemes?
Dynamic DataGridView missing horizontal scrollbar Accessing Properties within a Panel Inheritance Copy List(Of type) to another List(Of type) Reading a Webpage Source with Cyrillic Characters Serialization of Object Graph (Inheriting ArrayList) Removing a file with VB.NET Program Writing an app for both WinForms and Console use Get the Application Icon?? |
|||||||||||||||||||||||