| | |
Need help with text
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Sep 2007
Posts: 2
Reputation:
Solved Threads: 0
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
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
VB.NET Syntax (Toggle Plain Text)
mfntPrint = New Font("Arial", 14, FontStyle.Bold)
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- connect to text file database (Visual Basic 4 / 5 / 6)
- Body Text lost when sending hotmail (Web Browsers)
- edit text on a gif image in photoshop (Graphics and Multimedia)
- capturing text (C)
- i = system ("cd c:\text"); :( (C)
- Using string variables in a label or text box? (VB.NET)
Other Threads in the VB.NET Forum
- Previous Thread: tabPage.Add(textBox) ?
- Next Thread: Print Help!!
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic bing browser button buttons center check code crystalreport cuesent data database datagrid datagridview date datetimepicker dissertation dissertations dissertationtopic dropdownlist eclipse excel fade file-dialog filter ftp generatetags google gridview hardcopy images input insert intel internet listview mobile monitor ms net networking objects output panel passingparameters pdf picturebox picturebox1 port position print printing problem project read remove save searchbox searchvb.net select serial server settings shutdown soap survey table tcp temperature text textbox timer timespan toolbox transparency trim update user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio2008 web winforms wpf year






