On Oct 2, 2006, at 2:55 PM, Bart Pietercil wrote:
So the rundown is: when I have a Msgbox let the eventqueue become
empty and then let an action in a timer pick up.
Now not to be called lazy, :-) I tried a couple of other
possibilities where one of them suffered also from I think related
problems.
I'm still in a LostFocus event
if I do
if me.Text <> fld_password.Text then
me.Text = ""
fld_password.SetFocus()
end if
the fld_password.SetFocus() doesn't seem to get executed (and the
cursor just goes to the next (in taborder) field).
As I said, the workaround provided will do fine, but the learning
part of me is craving for more ;-)
One of the quirks in REALbasic that you must be aware of is that the
order of events is not guaranteed to be consistent between platforms
or even different Rb versions. For this reason, putting a setfocus in
a control losing its focus isn't guaranteed to work. The LostFocus
event should really be considered as a way to change previous
property settings in a housekeeping type manner as opposed to
triggering an event in another object. Setting the focus of another
object on a keypress should normally be handled within the Keydown
event of the object if that's what is triggering the focus change.
If one uses the mouse to change the focus then the Got focus event of
the control clicked on should call a method to reset the focus if
your test condition is true. I assume that you are using the Tab key
judging by your comments above.
In any case, you have lots of options to play with now. The main
thing is not to interrupt the focus transition with a MsgBox or
Message Dialog.
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>