Results 1 to 5 of 5

Thread: [RESOLVED] Chr(13)

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Resolved [RESOLVED] Chr(13)

    Hi all,

    I'm trying to get a program to input some text from a file into a text box. The code adds spacing for the various values, I.E.

    Code:
    Text1.text = Text1.text & Chr(13) & Var1 & Chr(13) & Var2
    Etc, etc. 13 should be the ASCII code for return, so it should add a return there. I've also tried Chr13 and chr 13, as well as Chr(10) which seems to be similar, all with no luck. Any advice?

    Thanks,
    Arby.

    EDIT: "Text1.text" is a multi-line textbox. Interestingly, I put the following code on a little text-program which I was testing the code on:

    Code:
    Private Sub Command1_Click()
    Text1.Text = Chr13 & "-" & Chr13 & "-" & Chr(13) & Chr(50)
    End Sub
    What appeared in the textbox was:
    --2

    indicating that it *IS* picking up the Chr(Num) code. I wonder why 13 and 10 aren't working?
    Last edited by BubbleLife; May 2nd, 2006 at 07:02 PM.

  2. #2
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: Chr(13)

    if you are trying to go to the next line try vbcrlf.

  3. #3
    Member
    Join Date
    Mar 2006
    Posts
    33

    Re: Chr(13)

    I have always used vbcrlf as a carriage return + linefeed.. chr(13) has never worked well for me in a text box..

    so it would be like text1.text=text1.text & vbcrlf & .....

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Apr 2005
    Posts
    248

    Re: Chr(13)

    Whoo! It works, thank you people ^__^

  5. #5
    Hyperactive Member
    Join Date
    Apr 2005
    Location
    Indiana
    Posts
    451

    Re: [RESOLVED] Chr(13)

    I normally use vbcrlf, but I think chr(10) & chr(13) have to be used together. One is line break, and the other is carriage return, if I remember correctly.

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