Dim lbl1 As WinForm.Label = e.Form.Controls("Label1")
Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1")
If lbl1.text <> txt1.text Then
msgbox("不匹配")
'Audio.Play("d:\test.wav")
Else
Dim t As Table = Tables("英语")
'Dim ar As Row = t.current
'ar("目录_状态") = "已学习"
't.Current("听写_次数") += 1
If e.Form.controls("checkbox1").checked Then
Dim drs As List(Of DataRow) = t.DataTable.Select("目录_状态 Is null Or 目录_状态 <> '学习中'")
If drs.count > 0 Then
Dim idx As Integer = Rand.Next(drs.count-1)
t.position = t.FindRow(drs(idx))
Dim r = t.current
r("目录_状态") = "已学习"
Dim sp As New DotNetSpeech.SpVoice()
sp.Speak(r("目录_英文"), DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
txt1.text = ""
Else
msgbox("已学完")
End If
Else
static vars("flag") As Integer = 0
static pidx As Integer = 0
Dim idx As Integer
If vars("flag") = 0 Then
idx = t.FindRow("目录_状态 is null or 目录_状态 <> '学习中'", t.Position+1, True)
pidx = idx
idx = t.FindRow("目录_状态 is null or 目录_状态 <> '学习中'", idx+1, True)
vars("flag") = 1
Else
idx = pidx
vars("flag") = 0
End If
If idx = -1 Then
msgbox("已学完")
Else
Dim r As Row = t.Rows(idx)
t.Position = idx
Dim sp As New DotNetSpeech.SpVoice()
sp.Speak(r("目录_英文"), DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
txt1.text = ""
End If
End If
End If