Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Remove Objects from a Form
Message
De
05/09/2005 07:57:00
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
05/09/2005 07:28:34
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01046174
Message ID:
01046762
Vues:
10
>>>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

No problem Fabio. You're right. For myself, I very rarely use "SET EXACT ON" and immediately set it back to OFF.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform