The textbox will not goto next line when addindg a new string or VBCrLf.
All the lines are put on the first line of the textbox. I need to put a
textfile in the Textbox using streamreader. Wordwrap=false, multiline=True,
scrollbars = both. Sample code is included. Using it as a test bed.
References are correct.
Dim sr As StreamReader = New StreamReader("\storage
card\cncmgr\setting.txt")

Dim input As String

input = sr.ReadLine()

While Not input Is Nothing

TextBox1.Text = input + vbCrLf

input = sr.ReadLine()

End While

sr.Close()

A far as I can see, this should work.

Thanks for any help

A. Myrick

Re: LF & CR in Textbox by Rod

Rod
Thu Dec 18 17:48:35 CST 2003

Hey Armon,

Curiously, you require /r/n. That is
o if there is such a thing you need vbLfCr
o or ^M^J (control-M control-J)
o or 0x000D 0x000A

Hope this helps,

Rod O.

Armon Myrick wrote:
> The textbox will not goto next line when addindg a new string or VBCrLf.
> All the lines are put on the first line of the textbox. I need to put a
> textfile in the Textbox using streamreader. Wordwrap=false, multiline=True,
> scrollbars = both. Sample code is included. Using it as a test bed.
> References are correct.
> Dim sr As StreamReader = New StreamReader("\storage
> card\cncmgr\setting.txt")
>
> Dim input As String
>
> input = sr.ReadLine()
>
> While Not input Is Nothing
>
> TextBox1.Text = input + vbCrLf
>
> input = sr.ReadLine()
>
> End While
>
> sr.Close()
>
> A far as I can see, this should work.
>
> Thanks for any help
>
> A. Myrick
>
>
>
>
>
>
>
>


Re: LF & CR in Textbox by Armon

Armon
Thu Dec 18 18:04:01 CST 2003

the vbLfCr is for Visual Basic. I think the /r/n is for C#.

"Rod O." <rolafson-ngfilter@magickite.com> wrote in message
news:u3%2334FcxDHA.2116@TK2MSFTNGP11.phx.gbl...
> Hey Armon,
>
> Curiously, you require /r/n. That is
> o if there is such a thing you need vbLfCr
> o or ^M^J (control-M control-J)
> o or 0x000D 0x000A
>
> Hope this helps,
>
> Rod O.
>
> Armon Myrick wrote:
> > The textbox will not goto next line when addindg a new string or VBCrLf.
> > All the lines are put on the first line of the textbox. I need to put a
> > textfile in the Textbox using streamreader. Wordwrap=false,
multiline=True,
> > scrollbars = both. Sample code is included. Using it as a test bed.
> > References are correct.
> > Dim sr As StreamReader = New StreamReader("\storage
> > card\cncmgr\setting.txt")
> >
> > Dim input As String
> >
> > input = sr.ReadLine()
> >
> > While Not input Is Nothing
> >
> > TextBox1.Text = input + vbCrLf
> >
> > input = sr.ReadLine()
> >
> > End While
> >
> > sr.Close()
> >
> > A far as I can see, this should work.
> >
> > Thanks for any help
> >
> > A. Myrick
> >
> >
> >
> >
> >
> >
> >
> >
>



Re: LF & CR in Textbox by Alex

Alex
Thu Dec 18 18:34:35 CST 2003

Set TextBox.Multiline to True
The line terminator is VbCrLf (or "\r\n" in C#)

"Armon Myrick" <amyrick@ideaone.net> wrote in message
news:eoS3S9bxDHA.3408@tk2msftngp13.phx.gbl...
> The textbox will not goto next line when addindg a new string or VBCrLf.
> All the lines are put on the first line of the textbox. I need to put a
> textfile in the Textbox using streamreader. Wordwrap=false,
multiline=True,
> scrollbars = both. Sample code is included. Using it as a test bed.
> References are correct.
> Dim sr As StreamReader = New StreamReader("\storage
> card\cncmgr\setting.txt")
>
> Dim input As String
>
> input = sr.ReadLine()
>
> While Not input Is Nothing
>
> TextBox1.Text = input + vbCrLf
>
> input = sr.ReadLine()
>
> End While
>
> sr.Close()
>
> A far as I can see, this should work.
>
> Thanks for any help
>
> A. Myrick
>
>
>
>
>
>
>
>



Re: LF & CR in Textbox by Armon

Armon
Thu Dec 18 20:30:42 CST 2003

been there - did that.
Still same result.
"Alex Feinman [MVP]" <public_news@alexfeinman.com> wrote in message
news:u4kihfcxDHA.3220@tk2msftngp13.phx.gbl...
> Set TextBox.Multiline to True
> The line terminator is VbCrLf (or "\r\n" in C#)
>
> "Armon Myrick" <amyrick@ideaone.net> wrote in message
> news:eoS3S9bxDHA.3408@tk2msftngp13.phx.gbl...
> > The textbox will not goto next line when addindg a new string or VBCrLf.
> > All the lines are put on the first line of the textbox. I need to put a
> > textfile in the Textbox using streamreader. Wordwrap=false,
> multiline=True,
> > scrollbars = both. Sample code is included. Using it as a test bed.
> > References are correct.
> > Dim sr As StreamReader = New StreamReader("\storage
> > card\cncmgr\setting.txt")
> >
> > Dim input As String
> >
> > input = sr.ReadLine()
> >
> > While Not input Is Nothing
> >
> > TextBox1.Text = input + vbCrLf
> >
> > input = sr.ReadLine()
> >
> > End While
> >
> > sr.Close()
> >
> > A far as I can see, this should work.
> >
> > Thanks for any help
> >
> > A. Myrick
> >
> >
> >
> >
> >
> >
> >
> >
>
>



Re: LF & CR in Textbox by Benjamin

Benjamin
Fri Dec 19 04:55:27 CST 2003

Armon Myrick wrote:

> While Not input Is Nothing
> TextBox1.Text = input + vbCrLf

The error is that you REPLACE the string in the text box.
Try this:
TextBox1.Text += input + vbCrLf

> input = sr.ReadLine()
> End While

Kind regards,

Benjamin Lukner
trinomix GmbH


Re: LF & CR in Textbox by Armon

Armon
Fri Dec 19 07:34:01 CST 2003

One question? Wouldn't you exceed the max characters on a single line. I
can't have the wordwrap on because the text file is a code file for a CNC
machine and each line is specific and has to be on it's own line.
"Benjamin Lukner" <Benjamin.Lukner_at_trinomix.de@mp3mounter.de> wrote in
message news:u%23esk5hxDHA.2136@TK2MSFTNGP10.phx.gbl...
> Armon Myrick wrote:
>
> > While Not input Is Nothing
> > TextBox1.Text = input + vbCrLf
>
> The error is that you REPLACE the string in the text box.
> Try this:
> TextBox1.Text += input + vbCrLf
>
> > input = sr.ReadLine()
> > End While
>
> Kind regards,
>
> Benjamin Lukner
> trinomix GmbH
>