Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Vfp 8.0 newbie question
Message
De
09/10/2003 12:00:59
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00836708
Message ID:
00836966
Vues:
9
Hi, Nancy

No. If you put the code in the INIT event, then it will run whenever the textbox is initialised. Not every time it refreshes. After initialisation, you can move it all you want, and the OriginalTop property will still contain the original information from design time.

Doing it this way also ensures that you won't forget to manually fill in some property with the information.

Alan

>Alan,
>
>I haven't created a class yet; I guess this is a good time. If I do it this way, won't this.originaltop with this.top every time the form is refreshed?
>
>Nancy
>
>>There is nothing at all wrong with Nick's response, but I think a better approach would be to create your own textbox class based on the Fox base textbox class. It's something you should do with all of the Fox controls and classes anyway.
>>
>>In your own textbox class, add a property called OriginalTop (same for the other position and size properties if you like).
>>
>>In your new textbox's init, just add:
>>
>>
This.OriginalTop = This.Top
>>
>>From then on, use your own controls rather than Fox's base controls. Later, when you subclass your textbox control to create whatever (datebox control, for example?), you won't have to rewrite the code each time - the behaviour will simply be inherited by your subclasses.
>>
>>Alan
>>
>>>i'm having a little problem with what i assume is a simple question. say i have a form designed with a text box where the ".top" property of that textbox is 100. when the program is running i move the textbox up and down the screen by programmatically changing the value of ".top". while the program is running how do i determine the original design-time value of ".top". i am basically adding a "reset to default button" and want the text box to return to its original position of ".top=100". i am assuming that value is accessible and i don't have to create a variable to store it.
>>>
>>>thanks,
>>>
>>>nancy
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform