Vb.net print code in a form

Posted by Jopito under VB.NET on 5/29/2013 | Points: 10 | Views : 8371 | Status : [Member] | Replies : 2
I have a form which i need to print the details entered,help me out with the code to print

Mark as answer if satisfied


Responses

Posted by: Saranya Boopathi on: 5/30/2013 [Member] Starter | Points: 25

Up
0
Down
Two approaches to print a form in VB.NET:

Private Sub buttonPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs)

Dim printDialog1 As PrintDialog = New PrintDialog
printDialog1.Document = printDocument1
Dim result As DialogResult = printDialog1.ShowDialog
If (result = DialogResult.OK) Then
printDocument1.Print()
End If
End Sub




Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) 

Handles Button1.Click
PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)
End Sub




Saranya Boopathi

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Annaharris on: 5/30/2013 [Member] Starter | Points: 25

Up
0
Down
Checkout the link that I have mentioned below as that will guide you to print your reports. http://simpleprogrammingexamples.blogspot.in/2009/02/printing-in-c-2_18.html

Jopito, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response