Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programatically adding a class to a form
Message
From
30/10/2006 01:45:16
 
 
To
30/10/2006 01:05:08
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01165430
Message ID:
01165431
Views:
10
>Hi all,
>
>A small help required from all you learned ones out there!
>
>While programetically adding a class into a form, I'm not sure how to include parameters, and keep getting the error "No parameter statement is found"
>
>My code:
>
>Thisform.AddObject('combo2', 'Combobox', 'c:\devstudio\panorama\cmbfield.vcx' )
>
>
>Thanks very much!
>
>Regards,
>
>Steve

A baseclass 'Combobox' has not an Init's parameter.
PUBLIC oform1

? SYS(16)
oform1=NEWOBJECT("form1")
oform1.Show
RETURN

DEFINE CLASS form1 AS form



	PROCEDURE Click
*		Thisform.AddObject("member","classname",1,2)
		Form::AddObject("member","classname",1,2)
		this.member.visible = .T.
	ENDPROC


* WITH Thisform.AddObject 
*	PROCEDURE AddObject 
*		LPARAMETERS cName, cClass, p1,p2 && add the parameters here
*	ENDPROC


ENDDEFINE

DEFINE CLASS classname as Combobox

	PROCEDURE Init
	LPARAMETERS p1,p2	&& add this
		ACTIVATE SCREEN
		? m.p1,m.p2

ENDDEFINE
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform