Results 1 to 7 of 7

Thread: printing to the printer with vb.net

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    printing to the printer with vb.net

    Hi,

    printing to the printer with vb .net

    how do i print to the printer from right to left with vb.net

    example in vb6:

    Printer.RightToLeft = True
    Printer.Print "abcd"
    Printer.EndDoc

    please send me small example

    thanking you in advance

  2. #2
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    RightToLeft No longer necessary. The direction of printing is controlled by the localization settings in Windows.
    Quoted from the VS Help files.

    VB Code:
    1. Dim WithEvents pDoc As Printing.PrintDocument
    2.  
    3.     Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
    4.         pDoc = New Printing.PrintDocument
    5.         pDoc.Print()
    6.     End Sub
    7.  
    8.     Private Sub pDoc_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles pDoc.PrintPage
    9.         e.Graphics.DrawString("abcd", New Font("Tahoma", 14), Brushes.Black, 15, 15)
    10.     End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224
    Hi,

    every word you wrote it's right.

    but it is not working

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    Whats not working? Explain.

    Are you getting an error? If so where? what error?

    If it prints but not right to left then you must change the localization.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224
    Hi,

    it is printing but not right to left

    yes, i change the localization

  6. #6
    Frenzied Member
    Join Date
    Nov 2003
    Posts
    1,489
    I'm trying to simply get functionality to my program. How do I get it so where when my user selects "print" the windows print dialog window shows up (the one where they can select a printer), and then the document will print to the selected printer?

    I tried the code listed above but it gave an error at "pdoc.print"

    what to do, what to do?

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Aug 2002
    Posts
    224

    Answer To Printing from Right To Left to the Printer in VB.NET

    Hi,

    Answer To Printing from Right To Left to the Printer in VB.NET

    Printing from Right To Left to the Printer in VB.NET
    You can download a small example:

    http://www.geocities.com/vmtnl/rtl.html

    Have a nice day

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