Private Sub docPrint_PrintPage(ByVal sender As Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) _
Handles docPrint.PrintPage
e.Graphics.DrawLine(New Pen(Color.Black, 2), 60, 90, 680, 90)
e.Graphics.DrawLine(New Pen(Color.Black, 1), 60, 93, 680, 93)
Dim strDisplay As String = "College Park Auto Repair"
Dim fntString As System.Drawing.Font = _
New Font("Times New Roman", 28, _
FontStyle.Bold)
e.Graphics.DrawString(strDisplay, fntString, _
Brushes.Black, 160, 100)
strDisplay = "Customer Car Repair Order"
fntString = New System.Drawing.Font("Times New Roman", 18, _
FontStyle.Bold)
e.Graphics.DrawString(strDisplay, fntString, _
Brushes.Black, 220, 150)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
60, 184, 680, 184)
e.Graphics.DrawLine(New Pen(Color.Black, 2), _
60, 187, 680, 187)
fntString = New System.Drawing.Font("Times New Roman", _
12, FontStyle.Bold)
e.Graphics.DrawString("Order Identification", fntString, _
Brushes.Black, 80, 200)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 250, 640, 250)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Bold)
e.Graphics.DrawString("Customer Name:", fntString, _
Brushes.Black, 100, 260)
fntString = New System.Drawing.Font("Times New Roman", 10, _
FontStyle.Regular)
e.Graphics.DrawString(txtCustomerName.Text, fntString, _
Brushes.Black, 260, 260)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 280, 640, 280)
fntString = New Font("Times New Roman", 10, FontStyle.Bold)
e.Graphics.DrawString("Address:", fntString, _
Brushes.Black, 100, 290)
fntString = New Font("Times New Roman", _
10, FontStyle.Regular)
e.Graphics.DrawString(txtAddress.Text, fntString, _
Brushes.Black, 260, 290)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 310, 640, 310)
fntString = New Font("Times New Roman", _
10, FontStyle.Regular)
Dim strAddress As String = txtCity.Text.ToString()& ", " & _
txtState.Text(+" " & txtZIPCode.Text)
e.Graphics.DrawString(strAddress, fntString, _
Brushes.Black, 260, 320)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 340, 640, 340)
fntString = New Font("Times New Roman", 10, FontStyle.Bold)
e.Graphics.DrawString("Car:", fntString, _
Brushes.Black, 100, 350)
fntString = New Font("Times New Roman", _
10, FontStyle.Regular)
Dim strCar As String = txtMake.Text & ", " & txtModel.Text & _
", " & txtCarYear.Text
e.Graphics.DrawString(strCar, fntString, _
Brushes.Black, 260, 350)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 370, 640, 370)
fntString = New Font("Times New Roman", 10, FontStyle.Bold)
e.Graphics.DrawString("Problem Description:", fntString, _
Brushes.Black, 100, 380)
fntString = New Font("Times New Roman", _
10, FontStyle.Regular)
e.Graphics.DrawString(txtProblem.Text, fntString, _
Brushes.Black, _
New RectangleF(260, 380, 420, 380))
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 400, 640, 400)
fntString = New System.Drawing.Font("Times New Roman", _
12, FontStyle.Bold)
e.Graphics.DrawString("Parts Used", fntString, _
Brushes.Black, 80, 430)
e.Graphics.DrawLine(New Pen(Color.Black, 2), _
80, 450, 680, 450)
e.Graphics.DrawString("Parts Name", fntString, _
Brushes.Black, 100, 460)
e.Graphics.DrawString("Unit Price", fntString, _
Brushes.Black, 420, 460)
e.Graphics.DrawString("Qty", fntString, _
Brushes.Black, 520, 460)
e.Graphics.DrawString("Sub-Total", fntString, _
Brushes.Black, 562, 460)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 480, 640, 480)
fntString = New Font("Times New Roman", 10, _
FontStyle.Regular)
Dim fmtString As StringFormat = New StringFormat
fmtString.Alignment = StringAlignment.Far
e.Graphics.DrawString(txtPartName1.Text, fntString, _
Brushes.Black, 100, 490)
e.Graphics.DrawString(txtUnitPrice1.Text, fntString, _
Brushes.Black, 480, 490, fmtString)
e.Graphics.DrawString(txtQuantity1.Text, fntString, _
Brushes.Black, 540, 490, fmtString)
e.Graphics.DrawString(txtSubTotal1.Text, fntString, _
Brushes.Black, 630, 490, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 510, 640, 510)
e.Graphics.DrawString(txtPartName2.Text, fntString, _
Brushes.Black, 100, 520)
e.Graphics.DrawString(txtUnitPrice2.Text, fntString, _
Brushes.Black, 480, 520, fmtString)
e.Graphics.DrawString(txtQuantity2.Text, fntString, _
Brushes.Black, 540, 520, fmtString)
e.Graphics.DrawString(txtSubTotal2.Text, fntString, _
Brushes.Black, 630, 520, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 540, 640, 540)
e.Graphics.DrawString(txtPartName3.Text, fntString, _
Brushes.Black, 100, 550)
e.Graphics.DrawString(txtUnitPrice3.Text, fntString, _
Brushes.Black, 480, 550, fmtString)
e.Graphics.DrawString(txtQuantity3.Text, fntString, _
Brushes.Black, 540, 550, fmtString)
e.Graphics.DrawString(txtSubTotal3.Text, fntString, _
Brushes.Black, 630, 550, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 570, 640, 570)
e.Graphics.DrawString(txtPartName4.Text, fntString, _
Brushes.Black, 100, 580)
e.Graphics.DrawString(txtUnitPrice4.Text, fntString, _
Brushes.Black, 480, 580, fmtString)
e.Graphics.DrawString(txtQuantity4.Text, fntString, _
Brushes.Black, 540, 580, fmtString)
e.Graphics.DrawString(txtSubTotal4.Text, fntString, _
Brushes.Black, 630, 580, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 600, 640, 600)
e.Graphics.DrawString(txtPartName5.Text, fntString, _
Brushes.Black, 100, 610)
e.Graphics.DrawString(txtUnitPrice5.Text, fntString, _
Brushes.Black, 480, 610, fmtString)
e.Graphics.DrawString(txtQuantity5.Text, fntString, _
Brushes.Black, 540, 610, fmtString)
e.Graphics.DrawString(txtSubTotal5.Text, fntString, _
Brushes.Black, 630, 610, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 630, 640, 630)
fntString = New Font("Times New Roman", _
12, FontStyle.Bold)
e.Graphics.DrawString("Jobs Performed", fntString, _
Brushes.Black, 80, 650)
e.Graphics.DrawLine(New Pen(Color.Black, 2), _
80, 670, 680, 670)
e.Graphics.DrawString("Job Name", fntString, _
Brushes.Black, 100, 680)
e.Graphics.DrawString("Price", fntString, _
Brushes.Black, 562, 680)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 700, 640, 700)
fntString = New Font("Times New Roman", 10, _
FontStyle.Regular)
e.Graphics.DrawString(txtJobDescription1.Text, fntString, _
Brushes.Black, 100, 710)
e.Graphics.DrawString(txtJobPrice1.Text, fntString, _
Brushes.Black, 600, 710, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 730, 640, 730)
e.Graphics.DrawString(txtJobDescription2.Text, fntString, _
Brushes.Black, 100, 740)
e.Graphics.DrawString(txtJobPrice2.Text, fntString, _
Brushes.Black, 600, 740, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 760, 640, 760)
e.Graphics.DrawString(txtJobDescription3.Text, fntString, _
Brushes.Black, 100, 770)
e.Graphics.DrawString(txtJobPrice3.Text, fntString, _
Brushes.Black, 600, 770, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 790, 640, 790)
e.Graphics.DrawString(txtJobDescription4.Text, _
fntString, Brushes.Black, 100, 800)
e.Graphics.DrawString(txtJobPrice4.Text, fntString, _
Brushes.Black, 600, 800, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 820, 640, 820)
e.Graphics.DrawString(txtJobDescription5.Text, _
fntString, Brushes.Black, 100, 830)
e.Graphics.DrawString(txtJobPrice5.Text, fntString, _
Brushes.Black, 600, 830, fmtString)
e.Graphics.DrawLine(New Pen(Color.Black, 1), _
100, 850, 640, 850)
fntString = New System.Drawing.Font("Times New Roman", _
12, FontStyle.Bold)
e.Graphics.DrawString("Order Summary", fntString, _
Brushes.Black, 80, 870)
e.Graphics.DrawLine(New Pen(Color.Black, 2), _
80, 890, 680, 890)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Bold)
e.Graphics.DrawString("Total Parts:", fntString, _
Brushes.Black, 500, 900)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Regular)
e.Graphics.DrawString(txtTotalParts.Text, fntString, _
Brushes.Black, 640, 900, fmtString)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Bold)
e.Graphics.DrawString("Total Labor:", fntString, _
Brushes.Black, 500, 920)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Regular)
e.Graphics.DrawString(txtTotalLabor.Text, fntString, _
Brushes.Black, 640, 920, fmtString)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Bold)
e.Graphics.DrawString("Tax Rate:", fntString, _
Brushes.Black, 500, 940)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Regular)
e.Graphics.DrawString(txtTaxRate.Text, fntString, _
Brushes.Black, 640, 940, fmtString)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Bold)
e.Graphics.DrawString("Tax Amount:", fntString, _
Brushes.Black, 500, 960)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Regular)
e.Graphics.DrawString(txtTaxAmount.Text, fntString, _
Brushes.Black, 640, 960, fmtString)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Bold)
e.Graphics.DrawString("Repair Total:", fntString, _
Brushes.Black, 500, 980)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Regular)
e.Graphics.DrawString(txtTotalOrder.Text, fntString, _
Brushes.Black, 640, 980, fmtString)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Bold)
e.Graphics.DrawString("Recommendations:", fntString, _
Brushes.Black, 100, 900)
fntString = New System.Drawing.Font("Times New Roman", _
10, FontStyle.Regular)
e.Graphics.DrawString(txtRecommendations.Text, fntString, _
Brushes.Black, New RectangleF(100, 920, 350, 280))
End Sub
|