A label should display multi lines by default, if this isn't the case with yours then I'm guessing that you have set the AutoSize property to TRUE (default is false). If this is the case you must also set the WordWrap property to TRUE (default is false). If you now resize the label - you should have multi-line text.
Another way is to set the caption from code, eg:
Label1.Caption = "first line text" & Chr(13) & "second line"
The above should work with any settings of AutoSize and WordWrap - chr(13) simply means start a new line and you can have as many chr(13) as you want.
If you want both words on the same line, but spaced so it looks like two lines you can use the space function,i.e.:
Label1.Caption = "Max" & Space(5) & "Mass"
Faxof,
Using Shift+Enter does not work for the Caption property of a label at design-time in VB6. What version of VB are you using.
If I want multi-line captions, I put in a special character like | and then in the form_load
Dim ctl as control
For Each ctl in Controls
if Lcase$(TypeName(ctl)) = "label" then
Ctl.caption = Replace(ctl.Caption,"|",vbCrlf)
End if
Next
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.