Add a line break in label.text

G

Guest

I am learning how to program using Visual Studio 2005 (I chose Visual Basic
to start).

My question is:

I have a sentence which I want to split in two. I would like half the
sentence on the first line, and the other half right under it, on the second
line. How can I accomplish this feat?

P.S. Right now I can only get the label to show the sentence to me all on
one line.
 
H

Herfried K. Wagner [MVP]

Drew Leon said:
I have a sentence which I want to split in two. I would like half the
sentence on the first line, and the other half right under it, on the
second
line. How can I accomplish this feat?

\\\
Me.Label1.Text = "Hello" & ControlChars.NewLine & "World"
///
 
C

Confessor

I am learning how to program using Visual Studio 2005 (I chose Visual
Basic to start).

My question is:

I have a sentence which I want to split in two. I would like half the
sentence on the first line, and the other half right under it, on the
second line. How can I accomplish this feat?

P.S. Right now I can only get the label to show the sentence to me all
on one line.

Label1.Text = "He thrusts his fists" & vbCrLf & "Against the Posts"

....which only works with explicitly entered text...

If you wanted to wrap automatically following a given number of
letters/words in a string variable, the coding would be a bit more
complicated, I think. Probably beyond my current skill level. A simple
Google search was sufficient to unearth this keyword...

Karma, don't fail me now,
The Confessor
 
G

Guest

Thank you very much Herfried. I spent the longest time trying to find the
answer to this question.
 
G

Guest

Thank you for your quick response. I was racking my head all morning
searching for the answer. Much appreciated.
 

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