Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to print entire content from vb .net

Status
Not open for further replies.

khiemadong

Technical User
Apr 26, 2003
6
US
i have a program which connect to the database and display them in a form (w/ two table, one in the main form and the other one is in the detail form). i try to create a button so that it can print the entire form but i cannot get it work. below is my code for the print event..pleae help me if you can
Dim linesPerPage As Single = 0
Dim yPos As Single = 0
Dim leftMargin As Single = e.MarginBounds.Left
Dim topMargin As Single = e.MarginBounds.Top
Dim line As String = Nothing
Dim myFont As New Font("Times New Roman", 16, FontStyle.Regular, GraphicsUnit.Pixel)
linesPerPage = e.MarginBounds.Height / myFont.GetHeight(e.Graphics)
yPos = 100

e.Graphics.DrawString(line, myFont, Brushes.Black, leftMargin, yPos, New StringFormat())
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top