使用上下左右键,在各个text里切换;帮个忙,马上给分!

解决方案 »

  1.   

    在text控件的KeyDown事件中加入如下语句Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    'Down key...
    If KeyCode = vbKeyDown Then
      Text2.SetFocus
    End If
    End Sub
      

  2.   

    或者取KeyCode的 ASCII码进行判断也行
      

  3.   

    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = vbKeyRight Or KeyCode = vbKeyLeft Or KeyCode = vbKeyUp Or KeyCode = vbKeyDown Then
            SendKeys "{tab}"
        End If
    End Sub
      

  4.   

    我的软件中是敲回车,进行切换Private Sub Text1_KeyPress(KeyAscii As Integer)
        If KeyAscii = 13 Then
            SendKeys "{tab}"
        End IfEnd Sub
      

  5.   

    Private Sub Form_KeyUp(KeyCode As Integer, Shift As Integer)
    MsgBox KeyCode
    End Sub
    到这个事件里面试试,这里可以采集到方向键的keycode
      

  6.   

    在keyUP里面去取它的keycode就行。
    -------------------------------------
    |           Ooooo              |     
    |            (  )              |
    |                ) /               | 
    |           (_/                |
    |一步一个脚印,努力学习,努力工作! |
    |___________________________________|