我想实现一个任何控件按“ENTER"都是输入“TAB",应该怎样做?

解决方案 »

  1.   

    Private Sub TEXT1_KeyPress(KeyAscii As Integer)
        if Keyascii=13 then Sendkeys "{TAB}"
    end sub
      

  2.   

    在Form中KeyPreview設為True,在
    Private Sub Form_KeyPress(KeyAscii As Integer)
        If KeyAscii = vbKeyReturn Then
            KeyAscii = 0
            SendKeys "{Tab}"
        End If
    End Sub
    就不用在每個控件里寫了.
      

  3.   

    在每一个控件的KeyPress事件里加一句话。
    if Keyascii=13 then Sendkeys "{TAB}"