Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetFocus - The BIG Question
Message
From
03/03/2005 16:07:39
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
03/03/2005 08:06:43
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00992328
Message ID:
00992557
Views:
24
>Its actually right that you'll also get this error if the form in question is called from When or Valid Event or in general, if When or Valid Event is in the calling stack. I tested it by calling the next form through the KEYPRESS Event and it worked. Also I discovered that in the forms that the SETFOCUS was working, the form(s) had been called from other events Not from When or Valid Event

The solution to this is not to call other forms from valid(), when(), rangehi(), rangelo() because these forms may contain setfocus somewhere in them. You may set a flag in any of these methods and return .t., and then in lostfocus check for this flag, call the form, reset the flag. The flag would be best set as a property of the object, so each object would have its own.

Also, if validation should return .f., then your lostfocus should do a NoDefault, to prevent the control from actually losing the focus.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform