Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

  • *Experts*
Posted

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?

Posted (edited)

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.'

Edited by hakari
  • *Experts*
Posted

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.

Dim f2 As New Form2
f2.Show()

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...