What do you put into visual basic to get a password box appear and then give you 3 chances to get the correct password if you do not enter the correct password 3 times then the program will close :)
( i am using button "CmdStart" ) Thank you :D
Copyright © 2024 QUIZLS.COM - All rights reserved.
Answers & Comments
Verified answer
not going to write your code for you, but I have made an example that should work.
use inputbox to get input, check the value, if wrong 3 times use "end" to end program.
to display a input box use:
myValue = InputBox(message, title, defaultValue)
If myValue Is "password" Then
'add code to do when it is correct
endif
code would be something like this, but you could do it a number of ways:
sub CmdStart()
correct = "password"
for try = 1 to 3
myValue = InputBox(message, title, defaultValue)
If myValue = correct Then
'add code to do when it is correct
exit sub
else
'if you need to do anything if the code is wrong
endif
next try
end
end sub
hi, I think this code helps U in form load u can type this code after selecting a textbox its name defaultly as text1 Private Sub Form_Load() Text1.PasswordChar = "*"// use can use *,#...as u like End Sub