CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Jun 2012
    Posts
    23

    How to add text Line By Line in Richtextbox?

    Name:  untitled.JPG
Views: 1063
Size:  6.2 KB

    Those text(ex. Line1)
    will have the text "My added Text" (ex. Line1MyAddedText)

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: How to add text Line By Line in Richtextbox?

    The same as you would to a label or multiline text box.

    Append the text and a newline

    Code:
    Text1.text=Text1.Text & "A Line of Text" & vbcrlf
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to add text Line By Line in Richtextbox?

    to a RTB?
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  4. #4
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: How to add text Line By Line in Richtextbox?

    The text box was just an example, didn't want to have him miss out on looking at the properties to see which one was for the RTB
    Always use [code][/code] tags when posting code.

  5. #5
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: How to add text Line By Line in Richtextbox?

    Other than Line (uses X,Y), Line Spacing, and the | character are classic examples
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  6. #6
    Join Date
    Jun 2012
    Posts
    23

    Re: How to add text Line By Line in Richtextbox?

    ahm .. guys ..
    be known that those are text that is already in the RTB...
    and all i wanted is when i click a command button it will add text line by line

  7. #7
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: How to add text Line By Line in Richtextbox?

    What I showed would add a line to what is there. If you want to add more than one line then you might want to do so in a loop. Since you have not told us where these lines are coming from nor if you are lookign for something specific there is not much more that can be said.

    To add a line of text you append it to what is already there and add a vbcrlf on the end to go to the next line or at the begining as need may be.
    Always use [code][/code] tags when posting code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured