khiemadong
Technical User
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())
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())