0
I’m putting together the login part of my system, only I’m facing a big problem. My cancel button from the login screen needs to receive two features. The first is that being clicked before the main screen of the system is opened the entire application is terminated. If the main screen is already open it is to make the second functionality that would cancel the user change at runtime ! That is, the logout cancellation, the user exchange canceled. However for the logic I am using to work, it has to be passed by an if, only the logout click is an Itemmenu of a Mainmenu. If I wear it like this
if FrmPrincipal.Logout1.Click = True then
It accuses error of incompatible type If I’ve done it this other way
if FrmPrincipal.Logout1.OnClick
He’s wrong and he doesn’t turn. That’s what I wanted to know... how do I make an Itemmenu run in an if loop.
This code you gave me continued giving the same error. Then the Login screen call it in the onCreate of the Main. I couldn’t quite understand what you said in the part about onShow.
– Alison Paulo
@Alisonpaulo, if you call the Login screen in the main onCreate, with a showmodal, it will be waiting for the return of the Login screen, because it is a Showmodal, in the onCreate of Login you could put a private variable as false, if it closes the login screen, will go back to the screen of the main onCreate you could feed in a variable the return of Login. Right after the Oncreate of the Main it falls in onShow, in this part you check if it is to login or not. I do not know if I was clear.
– Jefferson Rudolf
Interesting had not thought this way, I will implement now, let me just ask one thing, what would be Oklogin a variable? Excuse the question but I am junior programmer learning yet hehe. the variable blogin would be type tform?
– Alison Paulo
The two variables are of the type Boolean, one you declare in the main and the other in the Login, when you enter the onCrete of the Login you already declare it as False, because if you leave the screen of the Login it is already false, then no event will happen and when you return to the Main onCreate you feed the boolean variable of the main with the boolean variable of Login.
– Jefferson Rudolf
@Alisonpaulo, did you manage to solve the problem?... if you could mark the answer to help the other members of the forum.
– Jefferson Rudolf
So, by what I tested depending on how it is developing works yes, for me it did not work because it will directly influence the restrictions of logged in users. As it has a Free it will clear all user information logged in. And the restrictions have connection with the id of the logged in user, giving that freeandnil cleans the id there the system is without restrictions, but for what I tested it would work yes, for me unfortunately it did not, but I really appreciate your help, thanks to this I found a new logic for login in systems Delphi.
– Alison Paulo
@Alisonpaulo has decided for you, has how to mark the answer, so serves for other users. Thank you
– Jefferson Rudolf