Results 1 to 6 of 6

Thread: Enter in Textbox?

  1. #1

    Thread Starter
    New Member
    Join Date
    Jun 2000
    Posts
    2
    Here's my dilemma. I want to add a certain string into a textbox (Text1.Text = Text1.Text & StringIWant), and in the StringIWant, I would like several linefeeds & return carriages (also known as enters). Chr(10) & Chr(13) both display as boxes, rather than actual linefeeds. I was wondering if any APIs would help. Or whatever. Sendkeys are not an option, sorry.

    Thanks.

  2. #2
    Guest
    Set the MultiLine to True to have the Linefeeds work properly.

    If you have done that and it does not work, you can use the InStr to find the  character and replace them with a vbNewLine. If you have VB6, you can use the Replace function.


  3. #3
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Hello JChen!

    No need for API.

    Use this!

    Code:
    Me.Caption = "Hello" & vbCrLf
    Text1.Text = Me.Caption
    Chemically Formulated As:
    Dr. Nitro

  4. #4
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    Actually, you don't need to do that.

    Do this text1.text = vbcrlf

    Make sure the MultiLine property is false.

    If you have to have Multiline=True, then use the previous example.
    Chemically Formulated As:
    Dr. Nitro

  5. #5
    Fanatic Member
    Join Date
    Jan 2000
    Location
    Nitro
    Posts
    633
    I am sorry Chen to confuse you. I thought you want it the boxes. Megatron is right. Make Multiline to True and it should take care of your problem. Sorry again for the confusion.
    Chemically Formulated As:
    Dr. Nitro

  6. #6
    Guest
    Ha. I read your post and thought that he wanted the boxes. (Confusing). In any case, you got both solutions right there

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