Results 1 to 4 of 4

Thread: [RESOLVED] Printing contents of textbox during runtime?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2011
    Location
    Canada
    Posts
    23

    Resolved [RESOLVED] Printing contents of textbox during runtime?

    Now that I know how to change the font of a textbox during runtime, now I need to know how to print the contents of the said textbox during runtime. It's a text / source code editor that I'm making in VB6.

    I have the common dialog control set up to use the print dialog, by the way.

  2. #2
    VB-aholic & Lovin' It LaVolpe's Avatar
    Join Date
    Oct 2007
    Location
    Beside Waldo
    Posts
    19,541

    Re: Printing contents of textbox during runtime?

    The common dialog does not print. It will tell you what folder & filename the user selected (SaveAs), but you still need to save the contents to a file you create: open, print/write, close

    The FAQs section linked in my signature below does have examples of reading/writing a simple file.

    Wow! How did I read "print" and think "save"? Ignore above.
    Last edited by LaVolpe; Jun 4th, 2011 at 06:03 PM.
    Insomnia is just a byproduct of, "It can't be done"

    Classics Enthusiast? Here's my 1969 Mustang Mach I Fastback. Her sister '67 Coupe has been adopted

    Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.
    Read the HitchHiker's Guide to Getting Help on the Forums.
    Here is the list of TAGs you can use to format your posts
    Here are VB6 Help Files online


    {Alpha Image Control} {Memory Leak FAQ} {Unicode Open/Save Dialog} {Resource Image Viewer/Extractor}
    {VB and DPI Tutorial} {Manifest Creator} {UserControl Button Template} {stdPicture Render Usage}

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Printing contents of textbox during runtime?

    Actually as I'm sure you know LaVolpe, you don't need to a file to be able to print. So 3no7ch all you need to do if you want to is

    Code:
    Printer.Print Text1.Text
    ' This or ending the app prints whatever text you want to print
    Printer.EndDoc

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Mar 2011
    Location
    Canada
    Posts
    23

    Re: Printing contents of textbox during runtime?

    Actually, I already found something online, so I don't need help now.

Tags for this Thread

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