那你就在Text2的KeyPress事件里做你需要的处理啊。

解决方案 »

  1.   


    Private Sub Text2_KeyPress(KeyAscii As Integer)
      If KeyAscii = 13 Then
        KeyAscii = 0
      Call Command1_Click
      End If
    End SubPrivate Sub Command1_Click()
      'xxxxxxxxxxx
     End
    End Sub
      

  2.   

    Private Sub Text1_KeyPress(KeyAscii As Integer)
     If KeyAscii = 13 Then
       SendKeys "{Tab}"
     End If
    End Sub
      

  3.   

    Private Sub Command1_Click()
    'b = 1
    End SubPrivate Sub Text2_KeyPress(KeyAscii As Integer)
        If KeyAscii = 13 Then
            Command1.SetFocus
        End If
    End SubPrivate Sub Text2_LostFocus()
           Command1_Click
    End Sub
      

  4.   

    Private Sub Text2_KeyPress(KeyAscii As Integer)
      If KeyAscii = vbKeyReturn Then
          Command1_Click
      End If
    End Sub