I basically want VB to write a variable to a text file when the person clicks the X, since there will be no exit button.
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
Dim objstreamwriter As System.IO.StreamWriter
objstreamwriter = System.IO.File.AppendText ("numbers1.txt")
objstreamwriter.WriteLine(intfinal)
End Sub
That's what I have right now, intfinal is a variable that is constantly updated in the program in another sub procedure. I tried using objstreamwriter.writeline(val(me.label.text)) but that didn't work either.
What exactely is the Base Class Event for exit? And what code should I use?
Thanks guys.
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
Dim objstreamwriter As System.IO.StreamWriter
objstreamwriter = System.IO.File.AppendText ("numbers1.txt")
objstreamwriter.WriteLine(intfinal)
End Sub
That's what I have right now, intfinal is a variable that is constantly updated in the program in another sub procedure. I tried using objstreamwriter.writeline(val(me.label.text)) but that didn't work either.
What exactely is the Base Class Event for exit? And what code should I use?
Thanks guys.