Pirate Pirate - 4 months ago 7
Vb.net Question

How to make a label multiline in vb.net

I'm facing this issue. I have a label that have large text. Label value comes from database. So what i want, I want to view that text in label multiline but if the text is more then the width of label it cuts down.

Like,

-------------------------------
|This is label and i want it to|
--------------------------------


But i want this,

---------------------------------------------
|This is label and i want it to be multiline|
|when needed. |
---------------------------------------------

Answer

Follow these steps,

Go to properties of the label and set AutoSize : false

Now expend your label to max size of the content like.

--------------------------------------------------
|                                                 |
|                                                 |
--------------------------------------------------

Now your text will not be go outside of the label and automatically go to next line when reach the end of the label.

Comments