Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetFocus() from within a LostFocus event acting strangel
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00465934
Message ID:
00465945
Views:
17
It works as lostfocus IS expectED to work, I think. If you just want to go to field2 after field1, you can use Valid return code:

*from VFP Help:
*The Valid event can also return a numeric value.
*Returning a numeric value has one of three effects:
*If 0 is returned, the control does not lose focus.
*If a positive value is returned, the value specifies the number of controls *the focus advances. For example, if the Valid event returns 1, the next *control gets the focus.
*If a negative value is returned, the value specifies the number of controls *the focus moves back. For example, if the Valid event returns –1, the previous control gets the focus

Hope this help

>>>>>>>>>>>>>>>>>your message below
I have coded some setfocus() commands in a field's lostfocus. This seems to have an unexpected result in VFP6 service pack 4. The execution follows this path:

Field1.Valid start
Field1.Valid return

Field1.LostFocus start
execute field2.setfocus() in the lostfocus

Field2.when fires (as expected)
Field2.when returns

Field1.Valid fires (WHAT?)
Field1.Valid returns

Field2.Gotfocus fires
Field2.Gotfocus returns

Field2.when fires (what? when again AFTER gotfocus?)
Field2.when returns

Field1.LostFocus returns

We are now in Filed2 waiting for input.

Has anyone seen this before?

Weldon Adair
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform