Question How to use Print Form Power to print a Windows Form from console?

CoderRick

New member
Joined
Jun 29, 2010
Messages
1
Programming Experience
3-5
Hi I'm trying to print a Form that I created using a VB.Net console application. My console application creates an instance of a Windows Form and fills it with data. I then created an instance of the Print Form class from the Microsoft Power Pack and am trying to get the form I filled with data to print but no matter what I've tried it just prints the command console window.

Dim firstPage As New FrontPage 'Windows Form

Dim pf As New PrintForm 'Print Form Power Pack

firstPage.Visible = True

firstPage.Focus()

pf.Form = firstPage

pf.PrintAction = Drawing.Printing.PrintAction.PrintToPrinter

pf.Print()
 
Top Bottom