我试图让我的视觉基本代码说出多个文本框,每个文本框之间有 30 秒的延迟,到目前为止我有:
公开课形式1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If OpenFileDialog1.ShowDialog() = DialogResult.OK Then
End If
If My.Computer.FileSystem.FileExists(OpenFileDialog1.FileName) Then
Dim ioFile As New System.IO.StreamReader(OpenFileDialog1.FileName)
TextBox1.Text = ioFile.ReadLine()
TextBox2.Text = ioFile.ReadLine()
TextBox3.Text = ioFile.ReadLine()
TextBox4.Text = ioFile.ReadLine()
TextBox5.Text = ioFile.ReadLine()
TextBox6.Text = ioFile.ReadLine()
TextBox7.Text = ioFile.ReadLine()
TextBox8.Text = ioFile.ReadLine()
TextBox9.Text = ioFile.ReadLine()
TextBox10.Text = ioFile.ReadLine()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Dim SAPI
SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak(TextBox1.Text)
End Sub
结束类
基本上我有 10 个文本框,其中有 10 个单词(从 txt 文件加载),我有一个 txt 到语音代码,说第一个文本框,但我希望链接到按钮 2 的文本到语音代码来说出所有文本框每个文本框之间有 30 秒的延迟,我该怎么做?