Hallo ik ben een klein programmaatje aan het schrijven voor een wachtwachtwoord
Nu wil ik dat het na een enter toets de knop cmdok uitvoert
wat moet er dan hier precies tussen?
Code:
Public Class Form1
Dim pogingen As Integer
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
pogingen = 0
End Sub
Private Sub cmdok_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdok.Click
Dim woord, standaardpas As String
standaardpas = "abcd"
woord = txtpas.Text
If woord = standaardpas Then
MessageBox.Show("Paswoord ok")
End
Else
MessageBox.Show("Paswoord niet ok")
End If
pogingen = pogingen + 1
If pogingen >= 3 Then
End
End If
End Sub
Private Sub txtpas_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtpas.KeyPress
If Not ((Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) < 91) Or Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) < 123 Or Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) < 58) Then
e.Handled() = True
End If
txtpas.MaxLength = 7
If ((Asc(e.KeyChar) = 13)) Then
End If
End Sub
Private Sub cmdstop_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdstop.Click
End
End Sub
End Class
Nu wil ik dat het na een enter toets de knop cmdok uitvoert
Code:
Private Sub txtpas_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles txtpas.KeyPress
If Not ((Asc(e.KeyChar) >= 65 And Asc(e.KeyChar) < 91) Or Asc(e.KeyChar) >= 97 And Asc(e.KeyChar) < 123 Or Asc(e.KeyChar) >= 48 And Asc(e.KeyChar) < 58) Then
e.Handled() = True
End If
txtpas.MaxLength = 7
If ((Asc(e.KeyChar) = 13)) Then
End If
End Sub
wat moet er dan hier precies tussen?