Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I release those objects?
Message
 
À
27/05/2014 16:02:54
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01600733
Message ID:
01600746
Vues:
70
J'aime (1)
Hi Denis,

You need to use the method RemoveObject, below I show you a quick and dirty sample:
loForm			= CREATEOBJECT('myForm')
loForm.Show(1)

DEFINE CLASS myForm as Form
	width = 603
	height = 100
	myObjects = 20
	ADD OBJECT cmdRemove as CommandButton WITH Left = 260, Top = 80, Width = 60, Caption = 'Remove!'
	
	FUNCTION Init() as Boolean
		LOCAL lnObject, loText
		FOR lnObject = 1 TO thisform.myObjects
			thisform.NewObject('txt' + TRANSFORM(lnObject, '@L 999'), 'TextBox')
			WITH GETPEM(thisform, 'txt' + TRANSFORM(lnObject, '@L 999'))
				.Width		= 30
				.Left		= ((lnObject - 1) * .Width) + 1
				.Top		= 5
				.Value		= lnObject
				.Visible	= .t.
			ENDWITH
		ENDFOR
		RETURN .T.
	ENDFUNC
	
	PROCEDURE RemoveButtons() as VOID
		FOR lnObject = 1 TO thisform.myObjects
			thisform.RemoveObject('txt' + TRANSFORM(lnObject, '@L 999'))
		ENDFOR		
		RETURN NULL
	ENDPROC 

	PROCEDURE cmdRemove.Click() as VOID
		thisform.RemoveButtons()
		RETURN NULL
	ENDPROC
ENDDEFINE
"The five senses obstruct or deform the apprehension of reality."
Jorge L. Borges?

"Premature optimization is the root of all evil in programming."
Donald Knuth, repeating C. A. R. Hoare

"To die for a religion is easier than to live it absolutely"
Jorge L. Borges
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform