Question Print all Form content

Volation

New member
Joined
Dec 11, 2024
Messages
1
Programming Experience
Beginner
Hi to all,

i have to print all data stored in a Visual Studio project Form3 but i have no pack so i don't have PrintForm function.

There is another method to print all Form data with a button click?

Someone can help me?
 
The PrintForm component in the VB PowerPacks was a bit of a hack anyway. It's rare that you should ever want to print a picture of the form itself, rather than a formatted version of the data in the form, so it should rarely have been used anyway. You should do what everyone did before the PrintForm component and what pretty much all experienced developers kept doing, which is use the standard PrintDocument component. That's what the PrintForm does internally anyway, but doing it yourself gives you full control. Add a PrintDocument to your form in the designer, handle its PrintPage event and call its Print method on the Click of a Button or whatever. In the event handler, you use the Graphics object provided to draw your text with whatever formatting options you want. Start by reading the relevant documentation, do a bit of experimentation yourself and see what you can achieve, then post back with specific questions if something comes up.
 
Back
Top