I use multiple text lines in Labels, pretty much when you click that pencil next to the “Text” property and hit enter.
Are you able to edit a certain line instead of just replacing the whole thing?
Edit where? In the IDE? In the running app?
IDE: yes
App: no
Something like this may work:
Dim tempLabel() As String = Split(Label1.text, EndOfLine)
tempLabel(1) = "Replacing the second line."
Label1.text = Join(tempLabel, EndOfLine)
You get the complete text in Label1.text
You can split it into lines (using the Split method) if you want, edit the line you want, and join the lines again using Join, but that all seems a bit pointless.
Why do you want to just edit a line?
[quote=182901:@Bob Coleman]Something like this may work:
Dim tempLabel() As String = Split(Label1.text, EndOfLine)
tempLabel(1) = "Replacing the second line."
Label1.text = Join(tempLabel, EndOfLine)
[/quote]
When I try that it just shows an error
Works fine here. Make sure your label name is correct. Below is a quick sample project.
http://s000.tinyupload.com/index.php?file_id=96268281641361798130
It still not working, I just see this
And when I go over the error it says “OutOfBoundsExpectation”
Arrays start at element zero, not one. Try tempLabel(0) = "
or
if tempLabel.Ubound >= 0 then tempLabel(0) = "
That just replaces the whole thing
That means that your label is just wrapping and does not have EndOfLines defining a new line.