I must get asked once a month about the ability to print a form from a Visual Basic .NET program. Back in VB 6 and earlier a program could easily printout a form under program control. I used to write quick little programs that allowed the user to enter some data, do some calculations or data retrieval and display information on a form. Then I would have the program just print out the form and I’d have a little one page “report.” So it wasn’t fancy I didn’t care. I and a lot of other teachers used to use this feature to have students hand in a hard copy of what their form looked like while working. It was a lot easier than using PrintScreen and copying the image into a Word document.
But for a variety of reasons that feature never made it into Visual Basic .NET. At least not until now. The Visual Basic group has started to create what they are calling Microsoft Visual Basic 2005 Power Packs – “” One of the first of these power packs is the Microsoft PrintForm Component 1.0. This Power Pack lets you add a new control to a Windows Forms project so that you can easily print out a Windows form. I’ve tried it a little and it seems to work very well.
It only works with Visual Studio 2005 and the 2005 Express editions but I tried it with C# (using Visual C# Express) and it works with C# as well. That is one of the cool things about .NET – most things that work for one language work for all of them.