-
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.
-
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.
-
Hello JChen!
No need for API.
Use this!
Code:
Me.Caption = "Hello" & vbCrLf
Text1.Text = Me.Caption
-
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.
-
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.
-
Ha. I read your post and thought that he wanted the boxes. (Confusing). In any case, you got both solutions right there