Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't set Default button at run time
Message
De
03/05/1999 11:29:41
 
 
À
29/04/1999 09:13:22
Paul Frost
Instem Computer Systems Ltd
Stone, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00212505
Message ID:
00214563
Vues:
25
>>John -
>>
>>I think Paul Frost may have came up with the real problem (see his thread here) where he said that it's the 'intrinsic' VFP gotfocus() event behavior which resets the command button to its default value. I didn't think that applied to me because I missed him saying 'intrinsic' and I knew I didn't have any gofocus() code on my form. But I do set focus to a control on each page in the page activate, so I guess that's going to fire the intrinsic gotfocus event. This would tend to explain what I observed when I was stepping through the code: the property gets set, but 'a reset to the original default occurs in the intrinsic gotfocus behavior for all VFP controls
>>
>>MS says its been fixed in 6.0 and they offer a workaround which (as they say) is likely to be difficult to implement:( I certainly want to move to VFP 6.0, but didn't necessarily plan on doing it today...guess I better take a look the workaround...growl!
>
>Did you try using NoDefault ? As soon as I found that the SetFocus was causing the problem, I modified what I was trying to do to get the right effect, rather than try to find a way around the original problem. (I kept the same default button & changed it's caption, a cop out, I know, but it was workable).
>
>Paul

Paul -

No, I guess that would have worked too, but I ended up putting their suggestion of DODEFAULT in my base classes, followed by a form level method which resets the default button to the button I wanted. I already use a similar method to turn default on and off for other controls, so that wasn't too difficult. But it really is a pain overall, because I have code in a lot of got focus events, so I'm having to recheck everything for odd behavior. But again, thanks for the original info. I was going nuts trying to figure this out!

Sylvia
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform