On Oct 2, 2006, at 9:00 AM, Bart Pietercil wrote:
Hi Terry,
if I understand it correctly this would mean that the flag needs to
be a property of the window right? (if it is to maintain state when
the first event loops finishes)
Correct. But you still need something to react to the change in the
flag's boolean property and that's where the timer comes into play.
This flag can be done away with, however, if you simply set the mode
of a short period timer to Mode=1 in the lost focus event. Or you can
test the flag's state in the same manner by looking at the property's
value when the Timer executes it's Action event. The Timer's mode
would initially be 0 or Off.
if me.Text <> fld_p1_password.Text then Timer1.Mode=1 // This sets
the Timer to run once after all other current code is executed.
The timer's Action event would then show the MsgBox.
MsgBox " De paswoorden zijn niet identiek." In my words In English,
"This password is incorrect."
What you do after that is up to you.
You could also set both the flag and the timer's code to read the
condition of the flag in it's action event. It's a matter of taste,
retaining state or what you wish to do under that condition. The use
of a timer guarantees that it will eventually test whatever you wish
it to.
Remember, the Timer will only run when all other code is finished. It
will not execute its action event if there are other threads in your
app still running. I say this because you stated, "when the first
event loops finishes" which sort of implies that there's more code to
come.
Cheers,
Terry
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>