Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Remove Objects from a Form
Message
From
05/09/2005 06:29:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/09/2005 05:55:01
Aaron K. Y. Chu
Health & Care Co. Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
01046174
Message ID:
01046747
Views:
18
>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
Ç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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform