multiline

zingbats

Newcomer
Joined
Aug 11, 2003
Messages
8
I have just bought VB.NET and I think that is very well constructed and well designed.

I am making a PHP editor (like a text editor) to start off making simple programs. I can save files, edit files, but, when I open the text file into the main box, it only opens the first line of text within the file.

I tried the rich text thingy but that creates boxes as line breaks which aren't readable by notepad. It needs to be readable by notepad!. I stopped it printing with line break "boxes" by changing the box type to multiline text boxt.

Here is my code.

Code:
OpenDialog1.ShowDialog()
FileOpen(1, OpenDialog1.FileName, OpenMode.input)
Input(1, TextBox1.Text)
FileClose(1)

Are there any settings I need to change?

Kind regards;
Alex
 
First, dont use the old VB6 way of reading files, its slower then the new StreamReaders :).
This will do it, using a StreamReader:
Visual Basic:
OpenDialog1.ShowDialog()
Dim reader as new IO.StreamReader(OpenDialog1.FileName)
'new stream reader object with the file name from the dialog
TextBox1.Text = reader.ReadtoEnd() 'read the whole thing using
'ReadToEnd() method
reader.Close() 'close the strea,
:)
 
U learn summit everyday.

I would like to say that I am very impressed with the standard of this forum and the speed at which my query was answered. =)

I hope one day I will be here helping people as well :p
 
Back
Top