Feb 28th, 2002, 11:09 AM
#1
Thread Starter
Fanatic Member
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 .
Feb 28th, 2002, 11:10 AM
#2
Lively Member
Scroll Bars
Do you have the scroll Bar settings to "BOTH" on the control?
Feb 28th, 2002, 11:15 AM
#3
Thread Starter
Fanatic Member
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...
Feb 28th, 2002, 11:17 AM
#4
Lively Member
vbNewLine
Instead of using CHR(13) & CHR(10) try using vbNewLine or
vbCRLF
Feb 28th, 2002, 11:22 AM
#5
Bouncy Member
try adding the constant vbCrLf to your stings instead
i.e.
VB Code:
textbox.Text = textbox.Text & vbCrLf & "test"
Feb 28th, 2002, 11:24 AM
#6
Thread Starter
Fanatic Member
They still just show as vertical bars in the text box and dont force it to the next line
Feb 28th, 2002, 11:25 AM
#7
Lively Member
Code
I'd like to see your code. I do this text box thing in several places and they all work.
Feb 28th, 2002, 11:27 AM
#8
Thread Starter
Fanatic Member
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....
Feb 28th, 2002, 11:29 AM
#9
Thread Starter
Fanatic Member
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....
Feb 28th, 2002, 11:34 AM
#10
Bouncy Member
make sure that the textbox control's MultiLine property is set to True?
Feb 28th, 2002, 11:44 AM
#11
Thread Starter
Fanatic Member
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...
Feb 28th, 2002, 11:52 AM
#12
Bouncy Member
can you paste some of your code?
Feb 28th, 2002, 12:39 PM
#13
Thread Starter
Fanatic Member
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
Feb 28th, 2002, 01:37 PM
#14
Lively Member
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)
Feb 28th, 2002, 03:29 PM
#15
Thread Starter
Fanatic Member
thanks I didnt know there was a replace command...
what happens if I pass it nothing to replace with.. will it just remove ??
Feb 28th, 2002, 04:40 PM
#16
PowerPoster
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
Forum Rules
Click Here to Expand Forum to Full Width