Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. printing from file

printing from file

Scheduled Pinned Locked Moved Visual Basic
graphics
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Daniel Engelkes
    wrote on last edited by
    #1

    trying to print from a file but nothing prints. here is the code. Private Sub document_PrintPage(ByVal sender As Object, _ ByVal e As System.Drawing.Printing.PrintPageEventArgs) _ Handles docToPrint.PrintPage Dim printFont As New System.Drawing.Font _ ("Arial", 12, System.Drawing.FontStyle.Regular) ' Insert code to render the page here. ' This code will be called when the control is drawn. ' The following code will render a simple ' message on the printed document. If System.IO.File.Exists(SaveFileDialog1.FileName) Then count = 0 menu2 = File.OpenText(SaveFileDialog1.FileName) menu2 = System.IO.File.OpenText(SaveFileDialog1.FileName) Do Until menu2.Peek = -1 menuitem(count) = menu2.ReadLine 'e.Graphics.DrawString(menuitem(count), printFont, _ 'System.Drawing.Brushes.Black, 10, 10) 'e.Graphics.DrawString(writeline(count), printFont, _ 'System.Drawing.Brushes.Black, 10, 10) count = count + 1 Loop For counter = 0 To count e.Graphics.DrawString(menuitem(count), printFont, _ System.Drawing.Brushes.Black, 10, 10) e.Graphics.DrawString(writeline(count), printFont, _ System.Drawing.Brushes.Black, 10, 10) Next counter menu2.Close() End If ' Draw the content. End Sub

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups