Adding line breaks in label

L

lochuanjiang

Hi all,

I have written a program and the label.text is retrieve from the
database.
However the length of the string could be very long and i would wish to
have line breaks in certain portion

I tried manipulating the text in the database with \r\n but this does
not work.

Are there anyways to do it and i would still be able to use label?

Appreciate any help
 
M

Michael Bray

(e-mail address removed) wrote in @e3g2000cwe.googlegroups.com:
Hi all,

I have written a program and the label.text is retrieve from the
database.
However the length of the string could be very long and i would wish to
have line breaks in certain portion

I tried manipulating the text in the database with \r\n but this does
not work.

Are there anyways to do it and i would still be able to use label?

Actually, \r\n does work in a label, but the problem is that when your
program reads it from the database, it is reading the \ characters
literally, so it turns it into the equivalent of \\r\\n. Your best option
is probably to "pre-process the string" by replacing "\\r" with "\r" and
"\\n" with "\n" in the code after it reads it from the database.

-mdb
 
A

ahjiang

Michael said:
Actually, \r\n does work in a label, but the problem is that when your
program reads it from the database, it is reading the \ characters
literally, so it turns it into the equivalent of \\r\\n. Your best option
is probably to "pre-process the string" by replacing "\\r" with "\r" and
"\\n" with "\n" in the code after it reads it from the database.

yup it works now

appreciate your help :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top