Using vbCrLf in a Panel Ctrl

G

Guest

Hi,

I have a Label control with some text. I'd like to include some vbCrLf in
this textmass but it doesn't work.

lblTxt.Text = "Some text " & vbCrLf & "some new text..."

Can't I use vbCrLf in Label controls?

I've done it successfully in multiline textboxes, but then the up/down
arrows are rendered with this control.

Any ideas?

TIA

Kenneth P
 
P

Philipp Sumi

Hi Kenneth

A Panel just renders its contents as HTML. If your HTML contains line
breaks, your browser will just render a space. To achieve line breaks,
you need the corresponding HTML tag which is <br>.

lblTxt.Text = "Some text " & "<br> & "some new text..."

hth, Philipp
 
S

Steve C. Orr [MVP, MCSD]

Use the HTML <br> tag instead.

Example:
lblTxt.Text = "Some text <br> some new text..."
 

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

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,049
Latest member
Allen00Reed

Latest Threads

Top