Hello.
I'm working on my very first
VB 2008 Express program, having a little bit of experience with
VB 6. The two are radically different, so I'm respectfully requesting just a little bit of help.
For my first
VB 2008 program, I'm starting out simple. I have two text boxes, named Title and Director. You input text into each text box.
I also have a button named GENERATE, which generates a text file named c:\test.txt and stores the text box material.
Here is the code I've used for the GENERATE button:
Dim file As System.IO.StreamWriter
file = My.Computer.FileSystem.OpenTextFileWriter("c:\test .txt", True)
file.Write(Title)
file.Write(Director)
file.Close()
MessageBox.Show("Your file has been created.")
It took a considerable amount of research to figure out how to do something as rudimentary as this. Like I said, this is much different than
VB 6.
Here is what the text file's contents look like:
System.Windows.Forms.TextBox, Text: Full Metal JacketSystem.Windows.Forms.TextBox, Text: Stanley Kubrick
The above text is all in one line.
What I want to do is format the text file a certain way. I want the text to look like this:
Title: Full Metal Jacket
Director: Stanley Kubrick
And so on. I want the lines double-spaced.
I know how to do this with
VB 6, but not with
VB 2008, and my research hasn't come up with an explanation of how to format this correctly.
Soâ¦how do I revise this code so that there is a line for each text box string, how do I get rid of the System.Windows.Forms.TextBox stuff and replace it with my own headers, and how do I double-space between lines?
I realize this is probably rudimentary stuff, but for someone migrating to
VB 2008 or 2010, it's a challenge. Thank you for any assistance you care to give. J. Danniel