I need help declaring the DrawStringInBox (in bold), can't seem to figure out how to do it, any suggestions would be greatly appreciated:


Protected Sub PrintPageTitles(ByVal ev As System.Drawing.Printing.PrintPageEventArgs)
Dim psngWidth As Single = 0
Dim penLine As Pen = New Pen(Brushes.Black)
Dim recCurrent As RectangleF
Dim sfCurrent As New StringFormat
Dim msngYPos As Single


ev.Graphics.DrawRectangle(penLine, _
ev.PageBounds.Left + 100, _
ev.PageBounds.Top + 100, _
ev.PageBounds.Right - 200, _
ev.PageBounds.Bottom - 200)


mfntPrint = New Font("Arial", 14)
msngYPos = ev.MarginBounds.Top + _
(2 * mfntPrint.GetHeight(ev.Graphics))


recCurrent = New RectangleF(ev.MarginBounds.Left, _
ev.MarginBounds.Top, _
ev.MarginBounds.Right - 100, _
msngYPos)

sfCurrent.Alignment = StringAlignment.Center
ev.Graphics.DrawString("Depreciation Schedule", _
mfnrPrint, _
Brushes.Black, _
recCurrent, sfCurrent)


mfntPrint = New Font("Arial", 10)


msngFontHeight = mfntPrint.GetHeight(ev.Graphics)
msngYPos += msngFontHeight

Call DrawStringInBox(ev, cintCol1Start, msngYPos, _
cintColWidth, msngYPos + msngFontHeight, _
"Year")

Call DrawStringInBox(ev, cintCol2Start, msngYPos, _
cintColWidth, msngYPos + msngFontHeight, _
"Start Value")

Call DrawStringInBox(ev, cintCol3Start, msngYPos, _
cintColWidth, msngYPos + msngFontHeight, _
"Depreciation")

Call DrawStringInBox(ev, cintCol4Start, msngYPos, _
cintColWidth, msngYPos + msngFontHeight, _
"End Value")

End Sub

mfntPrint =  New Font("Arial", 14, FontStyle.Bold)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.