Foxtable(狐表)用户栏目专家坐堂 → 值不在预期的范围内


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

主题:值不在预期的范围内

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/8 16:18:00 [显示全部帖子]

看不出什么问题,试试

If e.sender.value > "" andalso  e.Form.Controls("textbox2").value > ""
If e.sender.value > e.Form.Controls("textbox2").value
    If e.Form.Controls("CheckBox3").checked = True
        Dim sp As New DotNetSpeech.SpVoice()
        sp.rate = 6
        sp.Speak("输入值大了", DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
    End If
    e.sender.value = Nothing
    e.sender.Select()
Else
    If e.Form.Controls("CheckBox3").checked = True
        sp.Speak(e.sender.value, DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
    End If
End If
end if

另外以后麻烦事件代码说明是哪个控件的什么事件

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/8 16:48:00 [显示全部帖子]

跟踪看是哪一句代码问题

调试技巧:http://www.foxtable.com/webhelp/scr/1485.htm

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/8 17:04:00 [显示全部帖子]

改不来就学。

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/8 17:05:00 [显示全部帖子]

上例子测试

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/8 17:58:00 [显示全部帖子]

所有的value都改成Text,如

If e.sender.text > e.Form.Controls("textbox3").text

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/9 8:24:00 [显示全部帖子]

回11楼

If e.sender.text > e.Form.Controls("textbox2").text 
    If e.Form.Controls("CheckBox3").checked = True
        Dim sp As New DotNetSpeech.SpVoice()
        sp.rate = 6
        sp.Speak("输入值大了", DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
    End If
    e.sender.text = 0
    e.sender.Select()
Else
    If e.Form.Controls("CheckBox3").checked = True
        sp.Speak(e.sender.text , DotNetSpeech.SpeechVoiceSpeakFlags.SVSFlagsAsync)
    End If
End If

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/9 8:30:00 [显示全部帖子]

回12楼,参考:http://www.foxtable.com/webhelp/scr/0741.htm

If e.KeyCode = Keys.Enter Then
    If Tables("表A").Position < Tables("表A").Rows.Count-1 Then Tables("表A").Position += 1
End If

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/9 10:38:00 [显示全部帖子]

If e.KeyCode = Keys.Enter Then
    If Tables("上分_table1").Position < Tables("上分_table1").Rows.Count-1 Then
        If e.Form.controls("CheckBox1").checked =True And  e.Form.controls("CheckBox2").checked =False
            Tables("上分_table1").Position += 1
                e.Cancel = True
        End If
    End If
End If

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/9 11:02:00 [显示全部帖子]

If e.KeyCode = Keys.Enter Then
    If Tables("上分_table1").Position < Tables("上分_table1").Rows.Count-1 Then
        If e.Form.controls("CheckBox1").checked =True And  e.Form.controls("CheckBox2").checked =False
            Tables("上分_table1").Position += 1
       e.Sender.Text = ""
                e.Cancel = True
        End If
    End If
End If

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


加好友 发短信
等级:超级版主 帖子:107880 积分:548763 威望:0 精华:9 注册:2015/6/24 9:21:00
  发帖心情 Post By:2016/10/9 14:17:00 [显示全部帖子]

If e.KeyCode = Keys.Enter Then
    e.Sender.WriteValue
    If Tables("上分_table1").Position < Tables("上分_table1").Rows.Count-1 Then
        If e.Form.controls("CheckBox1").checked =True And  e.Form.controls("CheckBox2").checked =False
            Tables("上分_table1").Position += 1
            e.Cancel = True
        End If
    End If
End If

 回到顶部
总数 11 1 2 下一页