以文本方式查看主题

-  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=92975)

--  作者:424318006
--  发布时间:2016/11/17 15:18:00
--  下一行筛选
点击下一行
如果TextBox1 输入的内容与Label1符合(相同)
则 光标下一行(在光标移动下一行时,不会选中听写结果列为 过关 的列 ),次数列加1(如果是0就改为1,如果是1就

改为2,如果是2就改为3)
读出移动后的Label1单词。
如果TextBox1 输入的内容与Label1不符合(不相同)
则 发出指定音乐文档声音,

这个能实现吗 
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:阅读.table



--  作者:有点青
--  发布时间:2016/11/17 16:17:00
--  

参考代码

 

Dim lbl1 As WinForm.Label = e.Form.Controls("Label1")
Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1")
If txt1.text > "" AndAlso lbl1.text <> txt1.text Then
    msgbox("不匹配")
    \'Audio.Play("d:\\test.wav")
Else
    Dim t As Table = Tables("英语")
    If t.Position = t.Rows.Count-1 Then
        msgbox("已是最后一行")
    Else
        For i As Integer = t.Position+1 To t.Rows.Count-1
            Dim r As Row = t.Rows(i)
            If r("听写结果") <> "过关" Then
                t.Position = i
                r("听写次数") += 1
                Dim sp As New DotNetSpeech.SpVoice()
                sp.Speak(r("单词"), DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
                Exit For
            End If
        Next
    End If
End If


--  作者:424318006
--  发布时间:2016/11/17 22:55:00
--  
哇!好强大, 只是 为什么我还是读的字母啊? 麻烦你了 大神。
--  作者:有点蓝
--  发布时间:2016/11/17 23:08:00
--  
更换其它的语音库试试,http://www.foxtable.com/webhelp/scr/2240.htm,看示例七



--  作者:424318006
--  发布时间:2016/11/19 12:04:00
--  
TextBox1 里面没有输入也可以点下一行呢 
--  作者:有点蓝
--  发布时间:2016/11/19 14:15:00
--  
测试没有问题,贴出出错代码
--  作者:424318006
--  发布时间:2016/11/19 17:51:00
--  
Dim lbl1 As WinForm.Label = e.Form.Controls("Label1")
Dim txt1 As WinForm.TextBox = e.Form.Controls("TextBox1")
If txt1.text > "" AndAlso lbl1.text <> txt1.text Then
    msgbox("不匹配")
    \'Audio.Play("d:\\test.wav")
Else
    Dim t As Table = Tables("英语")
    If t.Position = t.Rows.Count-1 Then
        msgbox("已是最后一行")
    Else
        For i As Integer = t.Position+1 To t.Rows.Count-1
            Dim r As Row = t.Rows(i)
            If r("听写结果") <> "过关" Then
                t.Position = i
                r("听写次数") += 1
                Dim sp As New DotNetSpeech.SpVoice()
                sp.Speak(r("单词"), DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
                Exit For
            End If
        Next
    End If
End If

出了两个问题 ,没输入内容一可以进入下一行 ,可以加一个随机不循环不?
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:阅读 (1).table



--  作者:有点青
--  发布时间:2016/11/20 10:21:00
--  
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("英语")
    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("听写次数") += 1
            Dim sp As New DotNetSpeech.SpVoice()
            sp.Speak(r("单词"), DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
            txt1.text = ""
        Else
            msgbox("全部过关")
        End If
    Else
        If t.Position = t.Rows.Count-1 Then
            msgbox("已是最后一行")
        Else
            For i As Integer = t.Position+1 To t.Rows.Count-1
                Dim r As Row = t.Rows(i)
                If r("听写结果") <> "过关" Then
                    t.Position = i
                    r("听写次数") += 1
                    Dim sp As New DotNetSpeech.SpVoice()
                    sp.Speak(r("单词"), DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
                    txt1.text = ""
                    Exit For
                End If
            Next
        End If
    End If
End If

--  作者:424318006
--  发布时间:2016/11/20 13:10:00
--  
麻烦你了,
现在有几个问题,
就是 当输入正确后 加 1 这个功能是输入到下一行了, 第二就是 点击随机会一直在第一行,可以取消 最后一行改为 当 听写状态 列 全部都为过关后 跳出窗口显示 已听写完成,不要最后一行跳槽最后一行,如果最后一行了就调至第一行 (听写状态不是 过关的 )

--  作者:有点青
--  发布时间:2016/11/20 18:51:00
--  
 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("英语")
    t.Current("听写次数") += 1
    t.Current("听写结果") = "过关"
    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
            Dim sp As New DotNetSpeech.SpVoice()
            sp.Speak(r("单词"), DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
            txt1.text = ""
        Else
            msgbox("全部过关")
        End If
    Else
        Dim idx As Integer = t.FindRow("听写结果 is null or 听写结果 <> \'过关\'", t.Position+1, True)
        If idx = -1  Then
            msgbox("全部过关")
        Else
            Dim r As Row = t.Rows(idx)
            t.Position = idx
            r("听写次数") += 1
            Dim sp As New DotNetSpeech.SpVoice()
            sp.Speak(r("单词"), DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
            txt1.text = ""
        End If
    End If
End If