Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.
Refresh label with a for loop
I've just registered and this being my first time on a forum like this, I am in need of some desperate help. I have written an assignment for my students but having no experience of using Delphi before I have had to spend hours learning how to use it. I do have relevant experience Pascal so it makes it easier.
The problem is that the program should ask the user for a password and if entered incorrectly three times, the "logon" button show be inactive forcing the user to close the program. If the user types in the correct password then a simple calculator should be displayed. I can do this but I cannot force the program to:-
1) Display the value for the number of attempts in a read only label
2) Force the program to make the "logon" button inactive after the user has typed an incorrect password three times.
I have displayed the code for the "logon" button below. Any help would be much appreciated! Thanks in advance!
[code]procedure Tnnn.btnlogonClick(Sender: TObject);
if edtpassword.Text = password then
MessageBox(0, 'Password Incorrect!','Integer Calculator', +mb_ICONINFORMATION);}
until (attempt<4) or (flag=true);
0 · ·