Code:
private void ispis_Click(object sender, System.EventArgs e)
{
printanje.PrintPage += new PrintPageEventHandler(ispisi_stranicu);
printanje.Print();
}
printanje deklariraš ovako: PrintDocument printanje = new PrintDocument();
i sad ti treba procedura koju pokrece event (ispis_stranicu)
Code:
private void ispisi_stranicu(object sender, PrintPageEventArgs ePrint)
{
Font font = new Font("Arial", 18);
SolidBrush boja = new SolidBrush(Color.Black);
ePrint.Graphics.DrawString("tekst", font, boja, 76, 200, new stringFormat());
ePrint.HasMorePages = false
}
Kada pritisnes button ispis na papiru ce ti ispisati "tekst" na poziciji 76, 200.