Visual Basic - sentencias do while

Life is soft - evento anual de software empresarial
 
Vista:

sentencias do while

Publicado por rodrigo salazar (1 intervención) el 08/04/2009 07:59:15
hola a todos, le cuento que es lo que necesito hacer
TENGO UNA CAJA DE TEXTO DONDE DIGITO CONTRASEÑA QUIERO HACER QUE ESTA ME DEJE SOLO UN MAXIMO DE 3 INTENTOS COMO LO PUEDO HACER CON UN SICLO REPETITIVO?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:sentencias do while

Publicado por P3L30N2009 (699 intervenciones) el 08/04/2009 10:48:17
No necesitas ningún bucle, sino mas bien un contador estático.

p.e. en el botón aceptar o al perder el foco el contros TextBox:

Static iCont As Integer
If Text1.Text <> "MiContraseña" Then
MsgBox "Contraseña incorrecta"
iCont = iCont + 1
Else
'.. procedimiento si es correcta
End If
If iCont = 3 Then
MsgBox "Se acabaron las oprtunidades"
End
End If
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar