Sometimes, we need to print a VB Form especially if it contains charts or data tables. A simple solution for printing forms in VB .Net 2005 is to use the Power Pack.
The Power Pack is a free toolkit for VB .Net 2005 which allows the developer to draw a line and an oval/rectangle shape. It also used to print a form. To download the Power Pack, go to: http://msdn2.microsoft.com/fr-fr/vbasic/bb735936.aspx
Using the Print Form is very easy.
Sample Code:
' Set the PrintAction to display a Print Preview dialog
PrintForm1.PrintAction = Printing.PrintAction.PrintToPreview
' Print a copy of the form
PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.FullWindow)
You can also hide the parts of the forms that you don't want to print. The Power Pack contains an example of how to use the Print Form.
Inscription à :
Publier les commentaires (Atom)
Aucun commentaire:
Enregistrer un commentaire