Word wrap and line breaks on labels?

Howdy,
I am passing the status on an operation to a label. I would like to have it on 2 lines. I am doing it like the code below. The line break (vbCRLF) seems to get ignored regardless what I try. Is there a trick to it? I don’t see a label property that would allow me to enable line wrapping. I would like to use a label as i will be changing the font color and font size depending on the message, or is another control the answer? I am using the Bootstrap 3 label.

WaitTimeReading = "Error:" & vbCRLF & "Server not reacheable."
lblWaitTime.value = WaitTimeReading

Found a solution, posting in case it could help anybody else. On the style of the label I put the lines below. First line is because I need my text right justified.

text-align: right;
white-space:pre;

How about using an html break?

“Error:</br>Server not reacheable.”


doesn’t work in a label - it just displays it.

  lblInstructions.value = "Add an input control with 2 boxes: one for age and one for the 2 letter state. <br> " + 
 "Add a header to the group, and put age and state in their own  input item controls. Add the right text to each input item. Stack the items horizontally."

value is the straight text. If you want it treated as html, do this:

Label1.innerHTML = "Add an input control with 2 boxes: one for age and one for the 2 letter state. <br> " + 
 "Add a header to the group, and put age and state in their own  input item controls. Add the right text to each input item. Stack the items horizontally."
1 Like