Home > Software engineering >  Using VB to write a program to enter the user name and password and press enter after no response, h
Using VB to write a program to enter the user name and password and press enter after no response, h

Time:11-13

Using VB to write a program to enter the user name and password and press enter after no response, how do you get?
The code is as follows:
Private Sub Text2_KeyPress (KeyAscii As Integer)
If KeyAscii=13 Then
If Text1="XXX" And Text2=1234 Then
Form1. Show
Form2. Hide
The Else
Text2=""
Text2. SetFocus
End the If
End the If
End Sub

CodePudding user response:

You may not be on TEXTBOX2 press enter

CodePudding user response:

1234 get quotes:
 
If KeyAscii=13 Then
If Text1="XXX" And Text2="1234" Then
Form1. Show
Form2. Hide
The Else
Text2=""
Text2. SetFocus
End the If
End the If

CodePudding user response:

You enter the user name password form is Form1, why also Form1. Show?
Seems should be Form2. Show?

CodePudding user response:

Form1. Hide
Form2. Show
Did you got

CodePudding user response:

Add a button control, write the login verification in the button control

CodePudding user response:

reference yachong reply: 3/f
your form the input user name password is Form1, why also Form1. Show?
Seems should be Form2. Show?
the truth

CodePudding user response:

2 3 floor said yes, two problems have to change
  • Related