Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do you display the year of the date field on a FORM?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00112588
Message ID:
00113124
Vues:
23
>Robert,
>
>From a design standpoint - what Ed suggested - while it would work - has a few shortcomings. For example, what if you changed the name of the textbox or something else? Specifcally, it does not take advantage of VFP's OO facilities.
>
>For a long-term solution, why not create a textbox class called txtYear? You could add a custom property called boundfield. Then, in the Refresh() of the TextBox, you could have code like this:
>
>*/ Code to trap for date data type. If date type, invoke code below.
>
>With This
> .Value = Year(.BoundField)
>EndWith
>
>
>I know I get blamed for being to critical of things posted up on UT. But, it stokes me somewhat that a little more thought is not put into some things that are posted up here. Folks keep throwing around that VFP is nice because it has OO features. Would'nt it be nice if somebody actually used OO in response to your initial question??????

although i would make a class for this, i'd still probably have answered the way Ed did -- Robert is still at the beginning of the learning curve for OO stuff, and i'd rather give him an answer that works (1 or 2 messages) than the theory and explanations to use OO (quite a few messages).

Maybe we should add an 'OO solutions to common problems' area...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform