Home All Groups Group Topic Archive Search About

Newbie: Textbox text from string

Author
10 Nov 2006 9:56 PM
Jarry
If I were to set textbox text from a string, as such:
    dim myString as string = "Hello"
    textbox1.text = myString
It of course works. But what is the rule concerning new lines, for
instance, the following:
    dim myString as string = "Hello" & chr(10) & "Goodbye"
    textbox1.text = myString
Then both are displayed on the same line even though:
    msgbox(myString)
would show them on different lines. How do I get example two to show
them on different lines?

Thanks

Author
10 Nov 2006 10:52 PM
RobinS
Dim myString As String = "Hello" & ControlChars.CrLf & "World"

Robin S.
--------------------------------
Show quoteHide quote
"Jarry" <HarryandJa***@gmail.com> wrote in message
news:1163195786.368154.78290@b28g2000cwb.googlegroups.com...
> If I were to set textbox text from a string, as such:
>    dim myString as string = "Hello"
>    textbox1.text = myString
> It of course works. But what is the rule concerning new lines, for
> instance, the following:
>    dim myString as string = "Hello" & chr(10) & "Goodbye"
>    textbox1.text = myString
> Then both are displayed on the same line even though:
>    msgbox(myString)
> would show them on different lines. How do I get example two to show
> them on different lines?
>
> Thanks
>
Author
11 Nov 2006 12:21 AM
Kevin
Change the Multiline property of the textbox to True.

Show quoteHide quote
On 10 Nov 2006 13:56:26 -0800, "Jarry" <HarryandJa***@gmail.com>
wrote:

>If I were to set textbox text from a string, as such:
>    dim myString as string = "Hello"
>    textbox1.text = myString
>It of course works. But what is the rule concerning new lines, for
>instance, the following:
>    dim myString as string = "Hello" & chr(10) & "Goodbye"
>    textbox1.text = myString
>Then both are displayed on the same line even though:
>    msgbox(myString)
>would show them on different lines. How do I get example two to show
>them on different lines?
>
>Thanks