Setting the label control width

Using the Label control, the display text is set at run time from the database. I am trying to control the maximum width of a control, for example, a maximum of 100 per line with the addition of extra characters to the next line.

I tried this by installing as well as using CSS with no luck:

 lbl_Feedback1.Width = 50; 

I believe the problem is that the text of the shortcut is updated while the application is running. How to solve this?

+4
source share
3 answers

To set the width of your label you need to set "display: block". Or install this in the css file:

 label, span { display: block } 

or using the inline style (from code):

 lbl_Feedback1.Style["display"] = "block"; lbl_Feedback1.Style["width"] = "100px"; 
+8
source

Have you tried using the max-width property? for example: max-width: 100px;

0
source

You should be able to use

Display: built-in unit;

It worked for me.

0
source

All Articles