Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Class to make character act like numeric field
Message
De
18/11/1998 11:35:09
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
 
 
À
18/11/1998 11:02:50
Pierre Sauve
Micro-Fox Canada Inc.
Montréal, Québec, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00158808
Message ID:
00158829
Vues:
17
Pierre,
To add to what Jim said, you might also want to look at the FSIZE() function which will return the length of the field rather than just the length of the value in the field just to make sure. Assuming the control source is set, try FSIZE(this.controlsource) - this is untested and you may have to strip the table name off the control source. HTH

>Hi everyone,
>
>I have created a class based on textbox where I have this following code in the gotfocus event :
>
>This.inputmask = replicate('9',len(this.value))
>This.value = padr(alltrim(this.value),len(this.value))
>This.refresh()
>
>Then , in the lostfocus event I have the reverse code :
>
>This.inputmask = ""
>This.value = parl(alltrim(this.value),len(this.value))
>This.refresh()
>
>The problem is that when I use this class inside a form , the different fields using that class show empty values . When the form comes up I would like to see the values for these fields as the are in the table and only execute the gotfocus/lostfocus code when the user tab in and out of these fields.
>What am I doing wrong ?
>Note that I also tried to put the code in the when/valid event combination without more success.
>
>Thanks in advance.
***************************
Bruce Gilmour

"Two things are infinite, the Universe and human stupidity. And I am not sure about the Universe."
- Albert Einstein
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform