thisform.saveasclass("myCalsslibName","myClassName","Some description if you need it")then just run the form, and click the button. Voila` You will now have a CLASS in the classlibrary you specified which is the same as the form code.
create class testform as form of testclasslib.vcx nowait SET CLASSLIB TO testclasslib lo = CREATEOBJECT("myform") lo.SaveAsClass("TestClasslib.vcx","testform2") lo.show() READ events DEFINE CLASS Myform as testform caption = "testform" ADD OBJECT cmdtoclasslib as commandbutton WITH ; Caption = 'SaveAsclass', ; Visible = .t. PROCEDURE unload CLEAR EVENTS PROCEDURE cmdtoclasslib.click thisform.SaveAsClass("TestClasslib.vcx","testform2") ENDDEFINEWhere Testform class is nothing more than a subclass of a basic form.
thisform.saveasclass("myCalsslibName","myClassName","Some description if you need it")>>