vb.net text wrapping

Shaded

New member
Joined
Feb 7, 2006
Messages
3
Programming Experience
Beginner
If you did not notice im a beginner. and what im trying to do is. well ill show you what i have

label159.text = label159.text + "My text"

and its pretty easy to understand that but i want the "My text" portion to be wrapped below the original text. Thank you. Also if you need more explanation and cant understand my description. Say so. Thank you again
 
Welcome to this great forum, Shaded!

There are several keycodes and codewords to do this, they all do some combination of Line Feed and Carriage Return. Those words actually date from pre-computer time, they used mechanical typewriters where there were separate mechanical functions used to do this. First they pulled a handle to feed the paper by one line, then they pulled the writer carriage back to return to beginning of line. These functions later evolved by mechanical automation, and the Return key was introduced to the standard keyboard layout. Today printers more or less still operate like this, only they are controlled digitally. How the time flies ;)

Finally to the coding, I choose the keyword vbNewLine:
VB.NET:
label159.text = label159.text & vbNewLine & "My text"
 
to .net way would be to use ControlChars.NewLine:
VB.NET:
label159.Text &= ControlChars.NewLine & "My text"

also in .net you can use the &=, +=, -=, *= and /= operators, so you can use:
VB.NET:
Label.Text &= "New"
instead of
VB.NET:
Label.Text = Label.Text & "New"
 
Thank you both for yourr input. It has helped me just how i ahd hoped it will. Expect to see more posts in the future from me on easy things for you and not yet learned by me. Thank you again.:)
 
Back
Top