Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically add code to all controls
Message
De
11/12/2003 18:07:41
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00858363
Message ID:
00858408
Vues:
17
THANKS TO ALL THAT HELPED!

The code that did it:
MODIFY FORM \profiler32\progs\forms32\scendo NOWAIT
aselobj(laForm, 1)
loForm = laForm(1)
for each loPage in loform.PageFrame.Pages
   FOR EACH oControl IN loPage.COntrols
      IF UPPER(LEFT(ocontrol.name,3))="TXT"
         LcDesiredCode = "THISFORM.mcalendorse=.T." + CHR(13) ;
         + oControl.ReadMethod("VALID")
         oControl.WriteMethod("VALID", LcDesiredCode)
      ENDIF
   ENDFOR
ENDFOR
RETURN
>
for each loPage in loForm.PageFrameName.Pages
>    FOR EACH oControl IN loPage.COntrols
>
>>working on it. the problem I am running into is that the form has a pageframe with 6 pages on it...
>>
>>>Run your code below from a PRG file. You need to account for the container classes that your texboxes are on in the modified code below.
>>>
>>>>That's what I'm currently working on, but for some reason after I do a dodefault in the init of the form, my labojects array does not get created using the code below:
>>>
>>>
>>>MODIFY FORM MyForm NOWAIT
>>>aselobj(laForm, 1)
>>>loForm = laForm(1)
>>>WITH THIS
>>>    FOR EACH oControl IN loForm
>>>        * test to see of baseclass is a textbox here. if not, loop
>>>		LcDesiredCode = "THISFORM.mcalendorse=.T." + CHR(13) ;
>>>		+ oControl.ReadMethod("VALID")
>>>		oControl.WriteMethod("VALID", LcDesiredCode)
>>>    ENDFOR
>>>ENDWITH
>>>
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform