Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tip of the Day --- Focus Gotcha
Message
De
09/09/1999 14:01:50
 
 
À
09/09/1999 14:00:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00262794
Message ID:
00263032
Vues:
31
Nahhh ---- 2:28 -- not even close :-)


>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.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform