Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Deleting fields on a form programmatically
Message
De
22/08/2008 05:31:14
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
 
 
À
22/08/2008 05:08:26
Jon Neale
Bond International Software
Wootton Bassett, Royaume Uni
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01340763
Message ID:
01341051
Vues:
11
Thisform.ControlCount is the count of controls if you adress.
Controls[i] you mean control on pos i If you remove first element, second will be on pos 1 and so on.
Sooner or later the loop will fail because there will be no control I (IOW the initial control(controlcount) is now on a pos smaller then i.

Agnes

>Ok, something I wil remember for the future, any particular reason for that?
>
>
>
>>>I think changing the visible setting is best but if you really want to remove them then you can loop through each object in the forms controlcount something like this:
>>>
>>>FOR i = 1 TO Thisform.ControlCount
>>> IF Thisform.Controls[i].BaseClass = "Label"
>>> Thisform.RemoveObject(Thisform.Controls[i].name)
>>> ENDIF
>>>NEXT
>>>
>>>>How do does one go about deleting fields on a form programmatically?
>>>>
>>>>Thx in advance
>>___
>>Jon,
>>
>>I would prefer
>>
>>FOR i = Thisform.ControlCount to 1 step -1
>>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord

Weeks of programming can save you hours of planning.

Off

There is no place like [::1]
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform