Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove Objects from a Form
Message
 
À
02/09/2005 08:53:18
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01046174
Message ID:
01046181
Vues:
18
>Dear All,
>
>I append several objects programmatically, how can I remove it "automatically"?
>e.g.
>
>nEditBox1
>nEditBox2
>nEditBox3... nEditBox999
>
>How can I issue a command to remove them all?
>
>
>FOR x = 1 TO 999
>    nLabel = EVALUATE([nEditBox]+TRANSFORM(x))
>    f_form.removeobject(nLabel)
>ENDFOR
>
>
>However, I don't know how many EditBox I added beforehand...?!
lnEditToRemove = 1
FOR nControl = 1 TO f_form.Controls
    IF UPPER(f_form.Controls(nControl).BaseClass) == "EDITBOX" AND;
       UPPER(LEFT(f_form.Controls(nControl).Name)) == "NEDITBOX"
       f_form.RemoveObject(f_form.Controls(nControl).Name)
    ELSE
       lnEditToRemove = lnEditToRemove + 1
    ENDIF
NEXT
(not tested)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform