Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Set focus without using setfocus()
Message
From
27/02/2004 19:32:24
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00881299
Message ID:
00881735
Views:
57
>Excellent observation Hilmar. I was just testing if you were paying attention :>

Just what I suspected <g>.

> But actually this was just an example of using object references in the code to cause "Pseudo SetFocus".

Yes, and I like the idea. Except that, as stated elsewhere, I prefer to do all validation when saving the record - but the use of object references is much cleaner than hardcoding a number which might change.

>The Ok example was included to illustrate how to remain on the current object or allow next object navigation. The code does depend on the Tab order of the objects, If anyone were to choose to use code like this to avoid the consequences of Setfocus in a Valid event, they MUST insure that objects which are referenced have a non-zero tabindex.

Even so, the object references are much better than any hard-coded numbers. It is just one more detail to pay attention to.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Previous
Reply
Map
View

Click here to load this message in the networking platform