well it seems you try to split the words it the value is greater than 25 characters,
here is the logic as per your code
Dim spacepos As Integer = 0
spacepos = Me.TextBox1.Text.LastIndexOf(" ", 25)
Me.TextBox2.Text = Me.TextBox1.Text.Substring(0, spacepos)
Me.TextBox3.Text = Me.TextBox1.Text.Substring(spacepos + 1, len - spacepos - 1)
MessageBox.Show(Me.TextBox2.Text.Length())
MessageBox.Show(Me.TextBox3.Text.Length())
but it seems the second textbox has more than 25 characters if the above logic is okay then don't read the below one
Dim tempstring As String = Me.TextBox1.Text
While tempstring.Length > 25
spacepos = tempstring.LastIndexOf(" ", 25)
MessageBox.Show(tempstring.Substring(0, spacepos))
tempstring = tempstring.Substring(spacepos + 1, tempstring.Length - spacepos - 1)
End While
MessageBox.Show(tempstring)
the above code splits all the word for 25 characters and below