Question Print ListBox

GHOST

New member
Joined
Aug 12, 2018
Messages
4
Programming Experience
1-3
I want to print the listbox into the table how can i do that without using "SQL Server"?
 
Last edited:
I don't understand the reference to SQL Server as it's got nothing at all to do with printing. I'm assuming that you are talking bout Windows Forms so I have moved this thread. Please post to the most appropriate forum you can, not the most general.

As for the issue, printing in Windows Forms is done using the PrintDocument class. You call its Print method and handle its PrintPage event and then use GDI+ to draw whatever you want printed. I would recommend that you do some research on that class and the basics of GDI+, try to put what you learn into practice and then post back if you encounter issues doing so. You should start by reading the MSDN documentation for the PrintDocument and Graphics classes and then search for more information if you need to.

Note that the Graphics class is the one you'll use to do the drawing, via the e.Graphics property in the PrintPage event handler. You'll need to do some calculations to determine where you want to draw and call DrawString for each item. If you want to draw a table then you'll also need to call DrawLine a number of times.
 
Back
Top Bottom