Originally posted by grimsk8ter11
Not to hard, Mis actually told me about this and i expanded on this a tad, and am now posting it for use with Build 1, (for reasons mis will knwo as soon as he get son MSN XD)
In frmLogin add these 2 subs
Private Sub txtName_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtPassword.SetFocus KeyAscii = 0 End If End Sub
Private Sub txtPassword_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Call picConnect_Click KeyAscii = 0 End if End Sub
thiis is basicly what they ALL will do, the first box moves to the second box when enter is pressed the second box clicks the submit button.
frmNewAccount
Private Sub txtName_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtPassword.SetFocus KeyAscii = 0 End If End Sub
Private Sub txtPassword_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Call picConnect_Click KeyAscii = 0 End if End Sub
frmDeleteAccount
Private Sub txtName_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then txtPassword.SetFocus KeyAscii = 0 End If End Sub
Private Sub txtPassword_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Call picConnect_Click KeyAscii = 0 End if End Sub
frmCredits
Private Sub Form_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Call picCancel_Click KeyAscii = 0 End Sub
finally the login fix
Private Sub picConnect_Click() If Trim(txtName.Text) <> "" And Trim(txtPassword.Text) <> "" Then Call MenuState(MENU_STATE_LOGIN) ElseIf Trim(txtName.Text) = "" And Trim(txtPassword.Text) = "" Then Call MsgBox("Please enter your login name and password!", vbOKOnly) ElseIf Trim(txtName.Text) = "" Then Call MsgBox("Please enter your login name!", vbOKOnly) ElseIf Trim(txtPassword.Text) = "" Then Call MsgBox("Please enter your password!", vbOKOnly) End If End Sub
thsi jsut tells them the thing(s) they forget to put into the lgon form, much more professional like.
[edit] 1. Added daves fix
|