System::Void docPrint_PrintPage(System::Object^ sender,
System::Drawing::Printing::PrintPageEventArgs^ e)
{
e->Graphics->DrawLine(gcnew Pen(Color::Black, 2), 60, 90, 720, 90);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 60, 93, 720, 93);
String ^ strDisplay = L"Georgetown Dry Cleaning Services";
System::Drawing::Font ^ fntString =
gcnew System::Drawing::Font(L"Times New Roman", 28,
FontStyle::Bold);
e->Graphics->DrawString(strDisplay, fntString,
Brushes::Black, 80, 100);
strDisplay = L"Customer Cleaning Order";
fntString = gcnew System::Drawing::Font(L"Times New Roman", 18,
FontStyle::Bold);
e->Graphics->DrawString(strDisplay, fntString,
Brushes::Black, 220, 150);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 60, 184, 720, 184);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 2), 60, 188, 720, 188);
fntString = gcnew System::Drawing::Font(L"Times New Roman", 12,
FontStyle::Bold);
e->Graphics->DrawString(L"", fntString,
Brushes::Black, 80, 200);
fntString = gcnew System::Drawing::Font(L"Times New Roman", 12,
FontStyle::Bold);
e->Graphics->DrawString(L"Customer Identification: ", fntString,
Brushes::Black, 100, 220);
fntString = gcnew System::Drawing::Font(L"Times New Roman", 12,
FontStyle::Regular);
e->Graphics->DrawString(txtCustomerName->Text+ L" - " +
txtCustomerPhone->Text, fntString,
Brushes::Black, 300, 220); ;
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 100, 240, 700, 240);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(L"Date Left: ", fntString,
Brushes::Black, 100, 260);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(dtpDateLeft->Value.ToString(L"D"), fntString,
Brushes::Black, 300, 260);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 100, 280, 700, 280);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(L"Time Left: ", fntString,
Brushes::Black, 500, 260);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(dtpTimeLeft->Value.ToString(L"t"), fntString,
Brushes::Black, 620, 260);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(L"Date Expected: ", fntString,
Brushes::Black, 100, 300);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(dtpDateExpected->Value.ToString(L"D"),
fntString, Brushes::Black, 300, 300);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(L"Time Expected: ", fntString,
Brushes::Black, 500, 300);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(dtpTimeExpected->Value.ToString(L"t"),
fntString, Brushes::Black, 620, 300);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 2), 100, 320, 700, 320);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(L"Item Type",
fntString, Brushes::Black, 140, 350);
e->Graphics->DrawString(L"Unit Price",
fntString, Brushes::Black, 300, 350);
e->Graphics->DrawString(L"Quantity",
fntString, Brushes::Black, 405, 350);
e->Graphics->DrawString(L"Sub-Total",
fntString, Brushes::Black, 500, 350);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 2), 140, 370, 640, 370);
StringFormat ^ fmtString = gcnew StringFormat;
fmtString->Alignment = StringAlignment::Far;
e->Graphics->DrawString(L"Shirts",
fntString, Brushes::Black, 150, 380);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(txtUnitPriceShirts->Text, fntString,
Brushes::Black, 350, 380, fmtString);
e->Graphics->DrawString(txtQuantityShirts->Text, fntString,
Brushes::Black, 440, 380, fmtString);
e->Graphics->DrawString(txtSubTotalShirts->Text, fntString,
Brushes::Black, 550, 380, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 140, 400, 640, 400);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(L"Pants",
fntString, Brushes::Black, 150, 410);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(txtUnitPricePants->Text, fntString,
Brushes::Black, 350, 410, fmtString);
e->Graphics->DrawString(txtQuantityPants->Text, fntString,
Brushes::Black, 440, 410, fmtString);
e->Graphics->DrawString(txtSubTotalPants->Text, fntString,
Brushes::Black, 550, 410, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 140, 430, 640, 430);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(cbxItem1->Text,
fntString, Brushes::Black, 150, 440);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(txtUnitPriceItem1->Text, fntString,
Brushes::Black, 350, 440, fmtString);
e->Graphics->DrawString(txtQuantityItem1->Text, fntString,
Brushes::Black, 440, 440, fmtString);
e->Graphics->DrawString(txtSubTotalItem1->Text, fntString,
Brushes::Black, 550, 440, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 140, 460, 640, 460);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(cbxItem2->Text,
fntString, Brushes::Black, 150, 470);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(txtUnitPriceItem2->Text, fntString,
Brushes::Black, 350, 470, fmtString);
e->Graphics->DrawString(txtQuantityItem2->Text, fntString,
Brushes::Black, 440, 470, fmtString);
e->Graphics->DrawString(txtSubTotalItem2->Text, fntString,
Brushes::Black, 550, 470, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 140, 490, 640, 490);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(cbxItem3->Text,
fntString, Brushes::Black, 150, 500);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(txtUnitPriceItem3->Text, fntString,
Brushes::Black, 350, 500, fmtString);
e->Graphics->DrawString(txtQuantityItem3->Text, fntString,
Brushes::Black, 440, 500, fmtString);
e->Graphics->DrawString(txtSubTotalItem3->Text, fntString,
Brushes::Black, 550, 500, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1), 140, 520, 640, 520);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Bold);
e->Graphics->DrawString(cbxItem4->Text,
fntString, Brushes::Black, 150, 530);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
12, FontStyle::Regular);
e->Graphics->DrawString(txtUnitPriceItem4->Text, fntString,
Brushes::Black, 350, 530, fmtString);
e->Graphics->DrawString(txtQuantityItem4->Text, fntString,
Brushes::Black, 440, 530, fmtString);
e->Graphics->DrawString(txtSubTotalItem4->Text, fntString,
Brushes::Black, 550, 530, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 2), 140, 550, 640, 550);
fntString = gcnew System::Drawing::Font(L"Times New Roman", 12,
FontStyle::Bold);
e->Graphics->DrawString(L"Order Summary", fntString,
Brushes::Black, 260, 600);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 2), 220, 620, 560, 620);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
10, FontStyle::Bold);
e->Graphics->DrawString(L"Cleaning Total:", fntString,
Brushes::Black, 260, 630);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
10, FontStyle::Regular);
e->Graphics->DrawString(txtCleaningTotal->Text, fntString,
Brushes::Black, 440, 630, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1),
220, 650, 520, 650);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
10, FontStyle::Bold);
e->Graphics->DrawString(L"Tax Rate:", fntString,
Brushes::Black, 260, 660);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
10, FontStyle::Regular);
e->Graphics->DrawString(txtTaxRate->Text, fntString,
Brushes::Black, 440, 660, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1),
220, 680, 520, 680);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
10, FontStyle::Bold);
e->Graphics->DrawString(L"Tax Amount:", fntString,
Brushes::Black, 260, 690);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
10, FontStyle::Regular);
e->Graphics->DrawString(txtTaxAmount->Text, fntString,
Brushes::Black, 440, 690, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 1),
220, 710, 520, 710);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
10, FontStyle::Bold);
e->Graphics->DrawString(L"Net Price:", fntString,
Brushes::Black, 260, 720);
fntString = gcnew System::Drawing::Font(L"Times New Roman",
10, FontStyle::Regular);
e->Graphics->DrawString(txtNetPrice->Text, fntString,
Brushes::Black, 440, 720, fmtString);
e->Graphics->DrawLine(gcnew Pen(Color::Black, 2),
200, 740, 560, 740);
}
|