Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Tip of the Day --- Focus Gotcha
Message
From
09/09/1999 14:00:19
 
 
To
09/09/1999 13:58:37
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00262794
Message ID:
00263029
Views:
24
I think you just beat your own record for fast response time.

;>)


>Heya JVP #2 ---
>
>Hmmm...I'll have to try that. In my case, I'm using a Form class that always have an OK button so it was always a safe bet to shift focus there. Other have suggested setting focus to itself.
>
>
>
>>Hi John,
>>
>>There's another way: .Value = .Value
>>
>>However, while this seems simple, any generic save method (with transactions, rollbacks, reverts, etc.) will have a problem not knowing the ActiveControl (particularily with a grid) let alone some other control on a form to SetFocus() to.
>>
>>I use a method with returns the object reference to the ActiveControl - even for a grid. Another method goApp.oFormManager.oActiveControlFlush() essentially does the following:
>>
>>
>>WITH goApp.oFormManager
>>     .oActiveControl.Value = .oActiveControl.Value
>>ENDWITH
>>
>>
>>I got the idea for this from the FFC - good stuff in there if one has the time to dig into it.
>>
>>
>>>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.
- Jeff
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform