Label - Multiline. [Amended]

Hello. A question please. I'd want to fill a label with different texts. Theses texts can have 2 lines. Can I set the number of characters in each line of the label ?

Thanks...

[191 byte] By [NetPochi] at [2007-12-28]
# 1

Hi,

Do the following instead.>>

Drag a textbox to your form.

Set the following properties to TRUE.

ReadOnly=True

MultiLine=True

Then drag the vertical height of your textbox and adjust the width to suit the font and text you are using.

Adjust the textposition property to Center if you want too.

In code

textbox1.text="This is line 1" & VbCrLf

textbox1.AppendText("This is line 2")

Hope that helps?

Regards,

S_DS

Spidermans_DarkSide at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 2

Label1.Text = "First Line" & vbCrLf & "Second Line"

works just fine and gives you a two line label.

If you want to set the number of characters on each line just use the String.Substring method to split it.

Dave299 at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Language...
# 3

Hi,

To Dave299.

I've never tried the &VBCrLf on a label.

Thanks, that's something else i now know.

I'd personally still prefer my 1st method as you can then

more easily setup mutiple lines of text at design time.

Regards,

S_DS

Spidermans_DarkSide at 2007-9-4 > top of Msdn Tech,Visual Basic,Visual Basic Language...