myform1 = newobject('clsform','classprg.fxp')
myform1.show()
read events && Don't forget to have a clear events (exit button, queryunload ...)
Cetin
>cetin,
>thanks a lot! finally i can make forms and transfer it to fxp, then my application becomes flexible on different client scenarios.
>i had this problem though:
>i have created a myclass.vcx that contains the clsform (a form class).
>the clsform has only a label with caption "can u see me?".
>i have created a standard form named "testform". the testform has a button to call an object of type clsform.
>
>myform1 = newobject('clsform','classprg.fxp')
>myform1.show()
>
>the form just flashes and is gone.
>
>i want it to show up by not making it modal form.
>
>pls. help...
>
>eric
>
>>a) To convert a vcx to a prg :
>>-Either do it in prg from start
>>-Or use Class browser\View code to get prg version
>>Yes your code is a prg sample.
>
>>b) Directly create the form from prg version.
>>In earlier versions (before VFP6) :
>
>>set procedure to myclasses.prg
>>myform1 = createobject('myform')
>
>>In VFP6 and later :
>>myform1 = NewObject('myform','myclasses.prg')
>
>>Cetin
>
>>>nice one!
>>>a) how about converting the vcx to prg (is this a utility/function to do this)?
>>>so that it would do something like this on my myform.prg:
>>>DEFINE CLASS MyForm AS Form
>>> PROCEDURE Click
>>> = MESSAGEBOX('MyForm has been clicked!')
>>> ENDPROC
>>>ENDDEFINE
>>>
>>>b) when the definition of the class is done on the prg. then i compiled it so i can use the fxp, how do i use that class inside my form's button.click()?
>>>should i do this:
>>>do myform.fxp
>>>myform1 = createobject('myform')
>>>myform1.click()
>>>
>>>-tia