473,386 Members | 1,924 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Adding line breaks in label

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

Oct 19 '06 #1
2 1430
lo**********@gmail.com wrote in news:1161271254.588381.115040
@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
Oct 19 '06 #2
Michael Bray wrote:
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 :)

Oct 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Steve | last post by:
I'm not sure if I should be using tables here to structure the layout or if CSS is okay. I have a data entry form in which I have floated the labels to one side, and given them a specific width....
2
by: Jacek Stepniewski | last post by:
Hi, I would like to use <BR> in label control to break the line, but the control converts "<" and ">" to entity. How can i break the line?? Jack
1
by: buran | last post by:
Dear ASP.NET Programmers, I am carrying the input of a textbox via querystring. When I put the value of querstring in a label control, the line breaks are removed. The whole text is displayed as...
2
by: Nathan Sokalski | last post by:
I have a form that is laid out like the following: ------------ | | LABEL CONTROL | IMAGE | | | _________ I want the Label control to be on multiple lines...
8
by: Nalaka | last post by:
Hi I am showing a text paragraph in a labe control. But, the label control is ignoring my "newLines".... (newline+carraige return) ( I correct this paragraph using a multiline textBox) how...
2
by: nigel | last post by:
Hello i have been working on an interactive programme,i wish to use a small amount of Tk.Which i have taken from a tutorial. from Tkinter import * root = Tk() w =Label(root, text="Congratulations...
2
by: MDB | last post by:
Hello All, I have a label in a form view that I need to have display the line breaks. Is there an easy way to do this? For some reason, I havn't been able to find a straigh answer on this. ...
9
by: sellcraig | last post by:
Microsoft access 2 tables table "data main" contains a field called "code" table "ddw1" is created from a make table query of "data main" Goal- the data in "code" field in needs to...
6
by: Clive Backham | last post by:
I need to set up forms where some input fields are mandatory and others are optional. A common convention is to place an asterisk on the labels of the mandatory fields. Of course, I can just hard...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.