以文本方式查看主题 - Foxtable(狐表) (http://www.foxtable.com/bbs/index.asp) -- 专家坐堂 (http://www.foxtable.com/bbs/list.asp?boardid=2) ---- 没有字符跳过 (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=115670) |
-- 作者:yangwenghd -- 发布时间:2018/3/12 11:16:00 -- 没有字符跳过 能帮忙看看红色的代码吗?可以加一个判断吗? 就是当 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编辑过]
|
-- 作者:有点甜 -- 发布时间:2018/3/12 11:26:00 -- If lbl1.text <> txt1.text Then
If txt1.text > "" Then
msgbox("不匹配")
|
-- 作者:yangwenghd -- 发布时间:2018/3/12 12:23:00 -- 能在帮忙看看吗? 感谢 感谢 就是 当TextBox1没有字符的时候 执行绿色代码,其他的都不执行。 当TextBox1不等于 Label1执行紫红代码。 当TextBox1等于 Label1执行蓝色以及后面的 Dim lbl1 As WinForm.Label = e.Form.Controls("Label1") Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1") If txt1.text = "" Then \'如果TextBox1没有字符,执行下面绿色代码 Dim sp As New DotNetSpeech.SpVoice() sp.Speak(e.Form.Controls("Label1").Text, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync) End If If lbl1.text <> txt1.text Then ’当TextBox1 有 字符且不等于Label1的时候执行下面代码 msgbox("不匹配") \'Audio.Play("d:\\test.wav") Dim sp As New DotNetSpeech.SpVoice() sp.Speak(e.Form.Controls("Label1").Text, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync) Else 当TextBox1等于 Label1执行绿色以及后面的 Dim t As Table = Tables("单词") z这样对吗?总感觉那里不对呢 感谢 感谢 Dim lbl1 As WinForm.Label = e.Form.Controls("Label1") Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1") If txt1.text = "" Then \'如果TextBox1没有字符,执行下面代码 Dim sp As New DotNetSpeech.SpVoice() sp.Speak(e.Form.Controls("Label1").Text, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync) Else 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 If lbl1.text = txt1.text Then Dim t As Table = Tables("单词") [此贴子已经被作者于2018/3/12 12:28:27编辑过]
|
-- 作者:有点甜 -- 发布时间:2018/3/12 14:51:00 -- Dim lbl1 As WinForm.Label = e.Form.Controls("Label1") Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1") If txt1.text = "" Then \'如果TextBox1没有字符,执行下面绿色代码 Dim sp As New DotNetSpeech.SpVoice() sp.Speak(e.Form.Controls("Label1").Text, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync) Else If lbl1.text <> txt1.text Then \'当TextBox1 有 字符且不等于Label1的时候执行下面代码 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("单词") End If end if |