help plz /w timers and creating txt files

hakari

Newcomer
Joined
Nov 29, 2003
Messages
7
for .net is do you know the code to make a .txtbox get recorded when u click on a button? for ex.
________________
|_____blah_______| <--type in text box (1st step)

____________
|___Record___| <--click button (2nd step)

3rd step: creates a .txt file of that contains the word "blah"


can u help me on this and is there a way to have forms loaded in a certain amount of time? like 1st frm, for 3 seconds, then hide and show 2nd frm.. etc
 
For writing to a file look into the System.IO.StreamWriter class. When you have the StreamWriter object ready, use the Write or WriteLine method and pass in the text of the TextBox to the method. When you are done writing don't forget to use the Flush() and Close() method, tomake sure everything is written to the file.

For the form problem, do you want to just keep changing the forms every 3 seconds or do it for some number of forms and stop?
 
i wanted it to go to the 2nd form on the click of a button, stop for 3 seconds, then go to the 3rd form automatically, stop for 3 seconds, then msg box and go back to the 1st form and stop.

and i put
me.hide()
form2.show()

but form2.show() is underlined. whats wrong?

'Reference to a non-shared member requires an object reference.'
 
Last edited:
For that code to work you would need to create a new instance of the form. Using its class name to identify will not work.
Visual Basic:
Dim f2 As New Form2
f2.Show()
 
Back
Top