I have a listbox with 1 or more textfiles, which im going to print as commands.
but I dont know how to make the streamreader read from listbox ?
so far I got this.:
public void OutputBtn_Click(object sender, EventArgs e)
{
PrintDocument PrintD = new PrintDocument();
PrintD.PrintPage += new PrintPageEventHandler(this.PrintDocument_PrintPage);
StreamReader SR = new StreamReader("C:\\myfile.txt");
PrintD.Print();
}
is there enyway I can change “C:\myfile.txt” or do I have to use “foreach” ?
Do you want something like this? I don’t fully understand the question
Ok so you have the listbox filled with filenames?