Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip of the Day --- Focus Gotcha
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00262794
Message ID:
00262976
Views:
20
>>Hi all ---
>>
>>Many of y'all know this one but many more might not. I had forgotten it and it bit me in the butt with a client:
>>
>>When calling a Save routine from a Toolbar button or Menu option, the changed data in the current control may not be saved. Why? Because the Control never really loses focus and, therefore, the underlying ControlSource is not updated with the new Value.
>>
>>The trick is to force a LostFocus. A good way to do that is to SetFocus() to an OK button or other non-databound control in the same Form.
>
>Exactly - I had to solve that one a while back. You can even have the control setfocus to itself, that's a little more generic way to do it...

I use the form.WriteBuffer() method since Tasmanian Traders for VFP 3.0 time... :)
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform