Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Guest ji, please consider donating today!   Become a Supporter    ::   Make a Contribution   
    Monthly (Recurring) Target: $300 :: Achieved: $95

How Do I Put An End Of Line Character In A TextBox

Discussion in 'Information Technology' started by Christopher Lusardi, Jul 28, 2006.

  1. Christopher Lusardi

    Christopher Lusardi
    Expand Collapse
    Guest

    With code such as the below how would I put an end of line character in
    the 2nd line of:

    Textbox1.Text = "Hello "
    Textbox1.Text =
    Textbox1.Text = "World"

    Thanks,
    Chris Lusardi
     
  2. Loading...


  3. Rick B

    Rick B
    Expand Collapse
    Guest

    Assuming you are trying to display data on more than one line, you'd do
    something like...

    = "This is line 1." & chr(13) & chr(10) & "This is line 2."


    --
    Rick B



    "Christopher Lusardi" <clusardi2k@aol.com> wrote in message
    news:1147799545.718019.114080@j33g2000cwa.googlegroups.com...
    > With code such as the below how would I put an end of line character in
    > the 2nd line of:
    >
    > Textbox1.Text = "Hello "
    > Textbox1.Text =
    > Textbox1.Text = "World"
    >
    > Thanks,
    > Chris Lusardi
    >
     
  4. Michael H

    Michael H
    Expand Collapse
    Guest

    Chris,

    Actually, after running the three lines of code below, your TextBox would
    only contain "World", as you are resetting the value each time.

    Here are some constants you might find useful:
    vbLF (Line Feed)
    vbCR (Carriage Return)
    vbCRLF (Carriage Return with Line Feed)

    You can use them like this:
    Textbox1.Text = "Hello " & vbCrLf & "World"

    Or like this (note that the new values are being Appended to the previous
    contents of the TextBox, not replacing the previous contents as your example
    was doing):
    Textbox1.Text = "Hello "
    Textbox1.Text = Textbox1.Text & vbCrLf
    Textbox1.Text = Textbox1.Text & "World"

    -Michael


    "Christopher Lusardi" wrote:

    > With code such as the below how would I put an end of line character in
    > the 2nd line of:
    >
    > Textbox1.Text = "Hello "
    > Textbox1.Text =
    > Textbox1.Text = "World"
    >
    > Thanks,
    > Chris Lusardi
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page