How to print the whole listbox out in a list in a printed document in Windows Forms Application?

How do you print out all the items in listbox to a document, so that the items will all get in a list after each other vertically.

this is my code in C++ visual studio, I checked the bok Pro Visual C++/CLI and the .NET 2.0 Platform, butthe answer I seek was hard to find, so please help:

private: System::Void printDocument1_PrintPage(System::Object^ sender, System::Drawing::Printing::PrintPageEventArgs^ e) {

System::Drawing::Font^ printFont = gcnew System::Drawing::Font("Arial", 30, FontStyle::Regular, GraphicsUnit::Pixel);

e->Graphics->DrawString("INKĂ–PSLISTAN", printFont, Brushes::Black, 25, 25);
e->Graphics->DrawString("_____________", printFont, Brushes::Black, 25, 25);

for (int i; i < (listBox1->Items->Count); i--)
{
e->Graphics->DrawString(listBox1->Items[i]->ToString(), printFont,
Brushes::Black, 25, 25);
}
}

How do you print the whole listbox-items in a document after each other in a listform?
Last edited on
Topic archived. No new replies allowed.