Foxtable(狐表)用户栏目专家坐堂 → 下一行筛选


  共有2535人关注过本帖树形打印复制链接

主题:下一行筛选

帅哥哟,离线,有人找我吗?
有点青
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:573 积分:2961 威望:0 精华:0 注册:2016/10/27 14:33:00
  发帖心情 Post By: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


 回到顶部
帅哥哟,离线,有人找我吗?
有点青
  2楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:573 积分:2961 威望:0 精华:0 注册:2016/10/27 14:33:00
  发帖心情 Post By: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

 回到顶部
帅哥哟,离线,有人找我吗?
有点青
  3楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:573 积分:2961 威望:0 精华:0 注册:2016/10/27 14:33:00
  发帖心情 Post By: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

 回到顶部
帅哥哟,离线,有人找我吗?
有点青
  4楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:二尾狐 帖子:573 积分:2961 威望:0 精华:0 注册:2016/10/27 14:33:00
  发帖心情 Post By:2016/11/20 18:56:00 [显示全部帖子]

自己看懂代码改成自己需要的

 回到顶部