改一改
Dim txt As WinForm.TextBox = e.Form.Controls("TextBox1")
Dim eidx As Integer = txt.text.Length - 1
Dim sidx As Integer = 0
For i As Integer = vars("SelectedText") To txt.text.Length - 1
If Asc(txt.text(i)) = 13 Then
eidx = i
Exit For
End If
Next
For i As Integer = vars("SelectedText")-1 To 0 Step -1
If Asc(txt.text(i)) = 13 Then
sidx = i
Exit For
End If
Next
msgbox(eidx)
msgbox(sidx)
'For i As Integer = 0 To txt.text.Length - 1
'output.show(txt.text(i) & Asc(txt.text(i)))
'Next
Dim str As String = txt.Text.SubString(sidx, eidx-sidx)
msgbox(str)
Dim sp As New DotNetSpeech.SpVoice()
sp.Speak(str, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFDefault)