DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: *Print Multi-line Textbox*

  1. #1
    Join Date
    Feb 2008
    Posts
    7

    *Print Multi-line Textbox*

    Good evening all. I am looking to print a multiline textbox (on commandbutton click) using the printer.print command. Is there any way to do this easily? Possibly a way to set the margins pre-print? Thanks so much for your help!

    Using: VB6

    Spencer

  2. #2
    Join Date
    Nov 2003
    Location
    Portland, OR
    Posts
    8,387
    http://support.microsoft.com/kb/140886

    It's much easier to do it with a RichTextBox control: http://support.microsoft.com/kb/146022
    Phil Weber
    http://www.philweber.com

    Please post questions to the forums, where others may benefit.
    I do not offer free assistance by e-mail. Thank you!

  3. #3
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,663
    Play around with this
    Code:
    Private Function PrintTextFile(sTextFile As String) As String
    If Dir(sTextFile) <> vbNullString Then
        Open sTextFile For Binary As #1
        PrintTextFile = Input(LOF(1), 1)
        Close #1
    End If
    End Function
    
    Private Sub Command1_Click()
    Screen.MousePointer = vbHourglass
    Printer.Print PrintTextFile("c:\ver.txt")
    Printer.EndDoc
    Screen.MousePointer = vbDefault
    End Sub

Similar Threads

  1. Replies: 2
    Last Post: 04-05-2006, 12:17 PM
  2. Multi line imputbox?
    By Code_Writer in forum VB Classic
    Replies: 5
    Last Post: 12-13-2005, 10:31 PM
  3. Replies: 0
    Last Post: 08-08-2005, 09:46 AM
  4. Sample Sites.
    By Murray Foxcroft in forum Web
    Replies: 5
    Last Post: 11-02-2000, 03:42 AM
  5. Multi line config...
    By Tim Cowan in forum Architecture and Design
    Replies: 7
    Last Post: 05-13-2000, 06:54 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center