Reputation: 3127
I have a Label
that has a large amount of text. The value comes from a database. What I want is to view that text in a multiline Label
but if the text is more than the width of the Label
it cuts down.
Like:
----------------------------------
|This is a label and I want it to|
----------------------------------
But I want this:
-----------------------------------------------
|This is a label and I want it to be multiline|
|when needed. |
-----------------------------------------------
Upvotes: 26
Views: 73216
Reputation: 1
You can use a ComboBox with BackColor same as Parent, Border None and Multiline True
Upvotes: -1
Reputation: 41
You can display the required message in multiline on a lable.
To accomplish this you have to assign the required data into a variable in multiline.
Use the following codes to accomplish this:
variable += variable + vbCrLf
This will help you assign the variable in multiline
label1.text = variable '
This will help to serve your purpose
Upvotes: 4
Reputation:
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.
Upvotes: 37