Foxtable(狐表)用户栏目专家坐堂 → 像excel 单元格 录入 记忆 怎么做


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

主题:像excel 单元格 录入 记忆 怎么做

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


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/11/24 12:09:00 [显示全部帖子]

textchanged事件

 

If e.Sender.text > "" Then
    systemready = False
    Dim idx As Integer = e.Sender.SelectionStart
    Dim fdr As DataRow = DataTables("表A").find("第一列 like '" & e.sender.Text.SubString(0,idx) & "%'")
    If fdr IsNot Nothing Then
        e.sender.text = fdr("第一列")
        e.Sender.SelectionStart = idx
        e.Sender.SelectionLength = e.Sender.Text.length-idx
    End If
    systemready = True
End If

 

keydown事件

 

If e.KeyCode = keys.delete Then
    Dim idx As Integer = e.sender.SelectionStart
    Dim str = left(e.sender.text, idx)
    str &= right(e.sender.text, e.sender.text.length-idx-e.Sender.SelectionLength)
    Systemready = False
    e.sender.text = str
    e.sender.SelectionStart = idx
    Systemready = True
ElseIf e.KeyCode = Keys.Back Then
    If e.sender.SelectionLength > 0 Then
        Dim idx As Integer = e.sender.SelectionStart
        Dim str = left(e.sender.text, idx-1)
        str &= right(e.sender.text, e.sender.text.length-idx-e.Sender.SelectionLength)
        Systemready = False
        e.sender.text = str
        If e.sender.text > "" Then
            e.sender.SelectionStart = idx
            Dim fdr As DataRow = DataTables("表A").find("第一列 like '" & e.sender.Text & "%'")
            If fdr IsNot Nothing Then
                e.sender.text = fdr("第一列")
                e.Sender.SelectionStart = str.length
                e.Sender.SelectionLength = e.Sender.Text.length-str.length
            End If
        End If
        systemready = True
        e.cancel = True
    End If
End If


 回到顶部