能帮忙看看红色的代码吗?可以加一个判断吗?
就是当 TextBox1 没有字符的时候 不弹出 msgbox("不匹配") ,然后执行后面的代码
如果TextBox1有字符的时候才显现msgbox("不匹配")窗口。
其实就改变一下如果没有字符的时候不弹出窗口,其他的都不变。。。 感谢 感谢
Dim lbl1 As WinForm.Label = e.Form.Controls("Label1")
Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1")
在这个地方可以加个条件吗? 就是当TextBox1 没有内没有字符的时候,不执行红色代码,
如果TextBox1有字符的时候就执行红绿黑所有代码,感谢 感谢
If lbl1.text <> txt1.text Then
msgbox("不匹配")
'Audio.Play("d:\test.wav")
Dim sp As New DotNetSpeech.SpVoice()
sp.Speak(e.Form.Controls("Label1").Text, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
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("已学完")
'Dim frm As WinForm.Form
'frm = Forms("确认窗口")
BaseMainForm.Visible = True
Forms("确认窗口").show() '只显示窗口
End If
Else
Dim idx As Integer
If vars("flag") = 0 Then
idx = t.FindRow("听写_状态 is null or 听写_状态 = '学习中'", t.Position+1, True)
vars("pidx") = idx
idx = t.FindRow("听写_状态 is null or 听写_状态 = '学习中'", idx+1, True)
vars("flag") = 1
Else
idx = vars("pidx")
vars("flag") = 0
End If
If idx = -1 Then
'msgbox("已学完")
'Dim frm As WinForm.Form
'frm = Forms("确认窗口")
BaseMainForm.Visible = True
Forms("确认窗口").show() '只显示窗口
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
[此贴子已经被作者于2018/3/12 11:17:11编辑过]