Thank You very much and yes, I don't have a problem writing to the file. I've tried everything to print.
Here is what I have so far:
-
Dim datListBox1 As New StreamWriter("ListBox1.txt") 'This opens the file
-
Dim intIndex As Integer
-
Dim intMaximum As Integer
-
-
intMaximum = ListBox1.Items.Count - 1
-
For intIndex = 0 To intMaximum
-
datListBox1.WriteLine(ListBox1.Items(intIndex))
-
Next intIndex
-
datListBox1.Close() 'Close the file
-
The last line is supposed to be: mblnIsDirty = False
Would I include the mblnIsDirty in a module?
I think that the line of code is if there was any changes made, I think.
Everytime I enter that last line it tells me It is not declared, but I don't know where to declare it. On that issue anyway. But it is saving it. Now I just don't know how to print the items. Here is what I have tried:
-
'Print out all items in the Listbox list
-
For intListIndex = 0 to ListBox1.Items.Count - 1
-
-
' set up a line
-
strPrintLine = CStr(ListBox1.Items(intListIndex)
-
-
' Send the line to the graphics page object
-
e.Graphics.DrawString(strPrintLine, fnPrintFont, Brushes.Black, sngPrintX, sngPrintY)
-
-
' increment the Y position for the next line
-
sngPrintY += sngLineHeight
-
I put the code in the Handles btnPrint.Click
But I get the same thing it says that well I get a lot os syntax errors
anyway, any help would be greatful. I just want to push the button and printing starts. Sounds easy, but having trouble.
Thank You for the reference web page. I'll check there for the print method also.
Have a good day