Results 1 to 16 of 16

Thread: Text Boxes and returns

  1. #1

    Thread Starter
    Fanatic Member kevin_sauerwald's Avatar
    Join Date
    Feb 2002
    Location
    outside Philly
    Posts
    516

    Text Boxes and returns

    I want to use a text box so I can use its scroll bars but when I push in text with chr(13) and chr(10)'s CR and LF they dont work. Everything is on the same line and the return characters dont act as return characters....

    Do I need to use a different object or set something on the text box or use different characters... or or or or or

    help..... I'm sure this is a simple topic that has been discussed 1000x of times... I hope
    Last edited by kevin_sauerwald; Feb 28th, 2002 at 11:13 AM.

  2. #2
    Lively Member
    Join Date
    Jan 2002
    Posts
    76

    Scroll Bars

    Do you have the scroll Bar settings to "BOTH" on the control?

  3. #3

    Thread Starter
    Fanatic Member kevin_sauerwald's Avatar
    Join Date
    Feb 2002
    Location
    outside Philly
    Posts
    516
    I just redid my message.. the control characters dont force it
    to the next line.... If I type in the box and hit return it works fine but not if I push in text that I get from elsewhere...

  4. #4
    Lively Member
    Join Date
    Jan 2002
    Posts
    76

    vbNewLine

    Instead of using CHR(13) & CHR(10) try using vbNewLine or
    vbCRLF

  5. #5
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    try adding the constant vbCrLf to your stings instead

    i.e.
    VB Code:
    1. textbox.Text = textbox.Text & vbCrLf & "test"
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  6. #6

    Thread Starter
    Fanatic Member kevin_sauerwald's Avatar
    Join Date
    Feb 2002
    Location
    outside Philly
    Posts
    516
    They still just show as vertical bars in the text box and dont force it to the next line

  7. #7
    Lively Member
    Join Date
    Jan 2002
    Posts
    76

    Code

    I'd like to see your code. I do this text box thing in several places and they all work.

  8. #8

    Thread Starter
    Fanatic Member kevin_sauerwald's Avatar
    Join Date
    Feb 2002
    Location
    outside Philly
    Posts
    516
    make a new project with a textbox and make a command button
    do this

    Text1.Text = "line1" + vbCrLf + "line2"


    then you'll (hopefully) see what I get

    line1||line2....

  9. #9

    Thread Starter
    Fanatic Member kevin_sauerwald's Avatar
    Join Date
    Feb 2002
    Location
    outside Philly
    Posts
    516
    strange.. now that I set my multiline to y for my little experimenti it worked fine.. but my big app doesnt work... let me check some things....

  10. #10
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    make sure that the textbox control's MultiLine property is set to True?
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  11. #11

    Thread Starter
    Fanatic Member kevin_sauerwald's Avatar
    Join Date
    Feb 2002
    Location
    outside Philly
    Posts
    516
    its set to Y... but still shows as the vertical bars...

    I wonder if it has something to do with the message going
    from procedure to procedure ??

    This is wierd.. I must be missing something... I need to investigate
    this further.. thanks for the help...

  12. #12
    Bouncy Member darre1's Avatar
    Join Date
    May 2001
    Location
    Peterborough, UK
    Posts
    3,828
    can you paste some of your code?
    Confucious say, "Man standing naked in biscuit barrel not necessarily ****ing crackers."

    Don't forget to format your code in your posts

  13. #13

    Thread Starter
    Fanatic Member kevin_sauerwald's Avatar
    Join Date
    Feb 2002
    Location
    outside Philly
    Posts
    516
    here is a sample of what its doing.. let me know what I did wrong if you can.. thanks.. must be something simple

    I attached a tiny project
    Attached Files Attached Files

  14. #14
    Lively Member
    Join Date
    Jan 2002
    Posts
    76

    try this

    Your problem is that the MID statements says to insert 1 character, but vbCrLf is 2 characters.

    try this instead
    Text1.Text = Replace(Text1.Text, "~", vbCrLf)

  15. #15

    Thread Starter
    Fanatic Member kevin_sauerwald's Avatar
    Join Date
    Feb 2002
    Location
    outside Philly
    Posts
    516
    thanks I didnt know there was a replace command...

    what happens if I pass it nothing to replace with.. will it just remove ??

  16. #16
    PowerPoster Arc's Avatar
    Join Date
    Sep 2000
    Location
    Under my rock
    Posts
    2,336
    the Replace statement has to have 2 perameters. If you want to replace a char with nothing use it like this.

    Replace(text1, "mywords", "")
    -We have enough youth. How about a fountain of "Smart"?
    -If you can read this, thank a teacher....and since it's in English, thank a soldier.


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