This ia ALL you need to do.
Put this code in the click event for this button:
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.
Like this
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")
ENDDEFINE
Where Testform class is nothing more than a subclass of a basic form.
Glenn
>hi,
>thank you for reply,
>Add a button on the form ? ok, what about aprogram....
>
>>Add a button on the form which has the following in the clidk event:
>>
thisform.saveasclass("myCalsslibName","myClassName","Some description if you need it")
>>
>>Run the form, and click the button. Voila`
>>
>>Glenn
>>>hi all,
>>>
>>>any idea to convert vfp program to form
>>>thanks