Click to See Complete Forum and Search --> : Textboxes
StudentProgrammer
Jan 19th, 2000, 05:54 AM
This will sound pathetic to most of you, but since I'm just learning VB (4) I don't know much about the "extras" within VB.
My question is how to skip lines when entering text into a textbox using txtText1.text = "text here"... so, how do I put in text, then jump down a couple of lines.
Thanks.
badgers
Jan 19th, 2000, 06:00 AM
first I have VB6 so I don't know what the VB4 limits may be.
Set the text box multiline property to true.
Private Sub Form_Load()
textbox1.text= "Hello" & vbcrlf & "World"
End Sub
will put:
Hello
World
in the text box.
------------------
I am so skeptacle, I can hardly believe it!
HarryW
Jan 19th, 2000, 06:02 AM
I think maybe there's a hard carraige return character. If you put that in, it should simulate pressing <ENTER>, or at least that's what I think.
Not sure how you get it now though. Maybe the Asc() function? Darned if I can remember. I think it has a ASCII code, so you should be able to use the function that converts an ASCII code into a character. Maybe Char() or something. If you look in the help index for Asc(), if that's not the right function, I'm pretty sure the 'see also' link will take you to the right one.
Then again, I could be completely wrong, and there isn't a hard carraige return character :)
Please tell me if I'm mistaken. I hope I'm not.
StudentProgrammer
Jan 19th, 2000, 06:03 AM
It works beautifully, thanks very much Badgers.
HarryW
Jan 19th, 2000, 06:03 AM
Erm... oh yeah. That too :D
StudentProgrammer
Jan 19th, 2000, 06:08 AM
Thanks for your reply Harry, just I got badgers' first and it is simpler and does exactly what I need it to do.
HarryW
Jan 19th, 2000, 06:21 AM
You're more than welcome, really. I think his idea is a little easier, don't you? Hehe :)
Another way would be to send the ascii code for a carriage return..
Chr(10)
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.