Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1") If txt.text.EndsWith(chr(10)) = False Then Dim ary() As String = txt.Text.Split(chr(13)) Dim str As String = "" For Each s As String In ary If s <> chr(10) Then str &= " " & s.trim & vbcrlf '行首空格 str &= vbcrlf & "" End If Next systemready = False txt.text = str txt.SelectionStart = txt.text.Length systemready = True End If