当在text1.text内输入密码后
直接按"回车"确定,而不用鼠标点击command1(确定).
怎么做???
 

解决方案 »

  1.   

    Private Sub text1_KeyPress(KeyAscii As Integer)
        If KeyAscii = 13 Then
            Call 确定按钮_Click
        End If
    End Sub
      

  2.   

    private sub text1_keypress(keyascii as integer)
    if keyascii=vbkeyreturn
       call command1_click
    endif
    end sub
      

  3.   

    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = 13 Then
            Command1_Click
        End If
    End Sub
      

  4.   

    把command1的default属性设置为true
      

  5.   

    Private Sub text_KeyPress(KeyAscii As Integer)
        If KeyAscii = 13 Then
            Call comamnd1_Click
        End If
    End Sub
      

  6.   

    方法一:  
        同  rexyudl(飞翔隼)   所述。
    方法二:
        则无需写程序,只要将确定按钮中的Default属性改为true即可。
      

  7.   

    把确定键的Tag属性改成ok就可以