Results 1 to 3 of 3

Thread: Print help

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jan 2001
    Location
    Ca
    Posts
    124

    Print help

    Hi All

    I'm new to Vb.net. I've been working with vb6.0 for years now. I'm trying to look at VB2005. I have been using the printer.print but i think i will have to print to a file then print that txt file. So with that said i've been looking for a good way to print but have had no luck. My old code looks like this.

    I was hoping someone could help.

    Reston


    VB CODE +++++++++++++++++++++++++++++++++++++++++++++
    Private Sub cmdPrint_Click()
    Ace = 69
    If Chk1 = 0 Then MousePointer = 11
    If Chk1 = 0 Then Printer.Font.Size = 10
    If Chk1 = 0 Then Printer.Print ""
    If Chk1 = 0 Then Printer.Print ""
    If OptConvex.Value = True Then XX = " CONVEX"
    If OptConcave.Value = True Then XX = " CONCAVE"

    'Printer.Print ""
    If Chk1 = 0 Then Printer.Print ""
    If Chk1 = 0 Then Printer.Print ""
    If Chk1 = 0 Then Printer.Print Tab(10); "OC"
    If Chk1 = 0 Then Printer.Print Tab(10); "Job: "; Text1.Text
    If Chk1 = 0 Then Printer.Print Tab(10); Format(Now, "m/d/yyyy")
    If Chk1 = 0 Then Printer.Print Tab(10); Format(Now, "hh:mm AM/PM")
    If Chk1 = 0 Then Printer.Print "___________________________________________________"

    If Chk1 = 0 Then Printer.Print ""
    If Chk1 = 0 Then Printer.Print Tab(10); "TRC"; Tab(52); txtROC & "''" + XX
    If Chk1 = 0 Then Printer.Print ""
    If Chk1 = 0 Then Printer.Print Tab(10); "Sr"; Tab(52); txtSf & "''"
    If Chk1 = 0 Then Printer.Print ""If Chk1 = 0 Then Printer.Print " "
    'Printer.Print Tab(10); "MLBT"; Tab(52); Val(lblTable)
    'Printer.Print " "
    'Printer.Print Tab(10); ""; Tab(52); Val(lblTable)
    If Chk1 = 0 Then Printer.Print " "
    If Chk1 = 0 Then Printer.Print " "
    If Chk1 = 0 Then Printer.Print "____________________________________________"
    If Chk1 = 0 Then Printer.EndDoc

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Print help

    VB.NET printing is completely different to VB6. The 2003 101 Samples from Microsoft contain a printing example. You can open the 2003 samples in 2005 without issue and the printing mechanism hasn't changed.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: Print help

    look into the PrintDocument, PrintDialog and possibly the PrintPreviewDialog or the PrintPreviewControl
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

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