我想给文本框里输入密码,再敲回车,从而出现一个窗体,这个效果怎么实现?

解决方案 »

  1.   

    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then Form2.Show
    End Sub
      

  2.   

    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = 13 Then Form2.Show
    End Sub
      

  3.   

    Private Sub Text1_KeyPress(KeyAscii As Integer)
        If KeyAscii = 13 Then Form2.Show
    End Sub13就代表回车,就这么简单
      

  4.   

    同意楼上棏.
    Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
    If KeyCode = 13 Then
    yjsy.Show  '要显示棏窗体
    End If
    End Sub
      

  5.   


    Private Sub Form_Load()
        Text1.PasswordChar = "*"
    End SubPrivate Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
        If KeyCode = 13 Then
            If Text1.Text = "PassWord" Then
                Form2.Show
            Else
                MsgBox "Not Right"
                Text1.SelStart = 0
                Text1.SelLength = Len(Text1.Text)
            End If
        End If
    End Sub
      

  6.   

    Private Sub Text1_change(KeyAscii As Integer)
        If KeyAscii = 13 Then Form2.Show
    End Sub
    我想比较好吧,我也用过
      

  7.   

    private sub text_keypress(keyascii as integer)
     if keyascii =13 then 
       if password=text.text then 
         form2.show
       end if
     end if
    end sub
      

  8.   

    private sub text_keypress(keyascii as integer)
     if keyascii =13 then 
       if text.text="aaa" then 
         form2.show
       end if
     end if
    end sub
      

  9.   

    Private Sub Text1_KeyPress(KeyAscii As Integer)   '回车
       If KeyAscii = vbKeyReturn Then
          Form2.show    '显示另一窗体
       End If
    End Sub
      

  10.   

    Private Sub Text1_KeyPress(KeyAscii As Integer)   '回车
       If KeyAscii = vbKeyReturn Then
          Form2.show    '显示另一窗体
       End If
    End Sub