Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

New line ??

Status
Not open for further replies.

Holm78

Programmer
Mar 5, 2002
60
SE
Hi all

I have an edit box and I user can select different alternatives, and each alternative have a text that apears in the edit box.
My question is how can i put in the code that there shoulb be a new line. As if I pressed enter?

ex.

Hello. My name is Bob

My wish is

Hello.
My name is Bob.

Thanks for help..

//Holm
 
This can be done by adding a chr(13) to the textbox. A little example:

myTextbox.value = 'Hello.' + chr(13) + 'My name is Bob'

Let me know if it worked,

Charl
 
While this will work fien for most purposes, if you plan to export this text you should also include the LINE FEED character CHR(10) after CHR(13). Some text editors, such as Notepad, will not show the text correctly without the line feeds. The way I usually do this is:
[tt]
#define CRLF CHR(13)+CHR(10)

myTextbox.value = 'Hello.' + CRLF + 'My name is Bob'
[/tt]
Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top