Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove Objects from a Form
Message
De
05/09/2005 07:28:34
 
 
À
05/09/2005 06:29:18
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01046174
Message ID:
01046756
Vues:
14
>>Dear Fabio,
>>
>>I'm sorry I don't understand what is your approach!
>>
>>For say, I've got a custom class called "nEditBox", named according to the record number like "A1","A2"..."A999"
>>
>>my prime objective is to remove them all... can I do this?
>>
>>
>>f_form.setall('destroy','nEditBox')
>>
>>
>>In which, 'destroy' is a custom method built in "nEditBox" class
>>
>>this.parent.removeobject(this.name)
>>
>
>
>*Custom removeobjects method
>lparameters toContainer, tcClass, tcNamePrefix
>local ix
>tcNamePrefix = iif(empty(m.tcNamePrefix),'',m.tcNamePrefix)
>For ix=toContainer.ControlCount to 1 step -1
>   With Evaluate('toContainer.'+toContainer.Controls(m.ix).Name)
>	If lower(.Class) == lower(m.tcClass) and lower(.Name) = lower(m.tcNamePrefix)
>		toContainer.RemoveObject(.Name)
>	endif
>   endwith
>endfor
>
>
>A button calling custom method:
>
>* Remove all nEditbox class instances that are members of thisform
>thisform.RemoveObjects(thisform,'nEditBox')
>* or
>* Remove all nEditbox class instances that are members of thisform where name starts with 'a'
>thisform.RemoveObjects(thisform,'nEditBox','a')

Cetin, pardon me.
Uses 
<pre>
... and LIKE(lower(m.tcNamePrefix)+'*',lower(.Name))
it is more readable and not require SET EXACT OFF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform