hi to all.. just a new member here & also a beginner in VB.NET.. we were assigned to make a payroll system and we've done most of its part.. but still there are big problems: computation of tax and print employee information.. well, the employee information is really long so we want it to be printed in a LANDSCAPE ORIENTAION.. anyone can help us?? please.. we're using mySQL & WAMP server for database..
here's the code we tried but didn't worked..
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs)
Dim PrintAreaHeight, PrintAreaWidth, marginLeft, marginTop As Int32
With PrintDocument1.DefaultPageSettings
PrintAreaHeight = .PaperSize.Height - .Margins.Top - .Margins.Bottom
PrintAreaWidth = .PaperSize.Width - .Margins.Left - .Margins.Right
marginLeft = .Margins.Left
marginTop = .Margins.Top
End With
If PrintDocument1.DefaultPageSettings.Landscape Then
Dim intTemp As Int32
intTemp = PrintAreaHeight
PrintAreaHeight = PrintAreaWidth
PrintAreaWidth = intTemp
End If
End Sub
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click
btnPrint.Hide()
philBack.Hide()
PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
PrintForm1.Print()
philBack.Show()
End Sub