Form2
|
public Form2 (string NoTransaksi, string Nama, string
Alamat, string Tujuan, string HargaTiket):this()
{
lbNoTransaksi.Text =
NoTransaksi;
lbNama.Text = Nama;
lbAlamat.Text = Alamat;
lbTujuan.Text = Tujuan;
lbHargaTiket.Text =
HargaTiket;
}
|
printDocument1
|
private void printDocument1_PrintPage(object
sender, System.Drawing.Printing.PrintPageEventArgs e)
{
var font =
new Font("Arial", 12);
e.Graphics.DrawString("Transaksi
Pembelian Tiket Bis \n", font, Brushes.Black, 50, 10);
e.Graphics.DrawString("\n"
+ "No Transaksi" + "\t" + ": " + lbNoTransaksi.Text
+ "\n", font, Brushes.Black, 25, 30);
e.Graphics.DrawString("\n"
+ "Nama" + "\t" + "\t" + ": " +
lbNama.Text + "\n", font, Brushes.Black, 25, 50);
e.Graphics.DrawString("\n"
+ "Alamat" + "\t" + "\t" + ": " +
lbAlamat.Text + "\n", font, Brushes.Black, 25, 70);
e.Graphics.DrawString("\n"
+ "Tujuan" + "\t" + "\t" + ": " +
lbTujuan.Text + "\n", font, Brushes.Black, 25, 90);
e.Graphics.DrawString("\n"
+ "Harga Tiket" + "\t" + ": " + lbHargaTiket.Text
+ "\n", font, Brushes.Black, 25, 110);
}
|