现在没别的事,写一段代码 Private Sub Command1_Click() vStr = Text1.Text lstr = Len(vStr) pos = InStr(vStr, vbCrLf) If pos = 0 Then MsgBox "没有换行符!" Exit Sub ElseMsgBox "第1个换行符在" & pos & "处" i = 1 Do While pos > 0 pos = InStr(pos + 1, vStr, vbCrLf) If pos > 0 Then i = i + 1 MsgBox "第" & i & "个换行符在" & pos & "处" End If Loop End If End Sub
Private Sub Command1_Click()
vStr = Text1.Text
lstr = Len(vStr)
pos = InStr(vStr, vbCrLf)
If pos = 0 Then
MsgBox "没有换行符!"
Exit Sub
ElseMsgBox "第1个换行符在" & pos & "处"
i = 1
Do While pos > 0
pos = InStr(pos + 1, vStr, vbCrLf)
If pos > 0 Then
i = i + 1
MsgBox "第" & i & "个换行符在" & pos & "处"
End If
Loop
End If
End Sub