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. C#
  4. print orders from different places

print orders from different places

Scheduled Pinned Locked Moved C#
csharpgraphics
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.
  • J Offline
    J Offline
    jogisarge
    wrote on last edited by
    #1

    Hello, i am very new to C# so please be patient. i am printing orders in my app. so i have a button which creates the printjob. the paper will be written in the Printpage-Event. now i want to have a function that gets th order-object as a parm and print it on the paper. the reason is, that an order must be printed on severall programm modules.

    private void btnDruck_Click(object sender, EventArgs e)
    {
    PrintDocument Druckjob = new PrintDocument();
    PrintDialog Druckermenue = new PrintDialog();
    PrintPreviewDialog Druckpreview = new PrintPreviewDialog();
    Druckjob.DocumentName = "Rechnung";

    Druckjob.PrintPage += new PrintPageEventHandler(Druckjob\_PrintPage);
    Druckpreview.Document = Druckjob;
    Druckermenue.Document = Druckjob;
    if (Druckermenue.ShowDialog() == DialogResult.OK)
    {
    	Druckjob.Print();
    }
    Druckjob.PrintPage -= new PrintPageEventHandler(Druckjob\_PrintPage);
    

    }
    void Druckjob_PrintPage(object sender, PrintPageEventArgs e)
    {
    Graphics g = e.Graphics;
    StringFormat lineFmtRight = new StringFormat();
    lineFmtRight.Alignment = StringAlignment.Far;
    g.PageUnit = GraphicsUnit.Millimeter;

    // Druckausgabe ...
    // Drucken ..
    
    g.Dispose();
    

    }

    bye jo

    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