Puedes usar la función NEWOBJECT() y el método ADDOBJECT(), algo asi como:
miForm = CREATEOBJECT("Form")
miForm.Visible = .T.
miForm.AddObject("miGrid","Grid")
miForm.miGrid.ColumnCount = 2
miForm.miGrid.Visible = .T.
Para asignar código a los eventos del grid puedes usar la función BINDEVENT(), mas o menos así:
miForm.AddProperty("miClase")
miForm.miClase = NEWOBJECT("Metodos_Contabilidad","_clsContabilidad.fxp","sistema.exe")
BINDEVENT(miForm.miGrid.Column1,"Setfocus",miForm.miClase,"_Contabiliza")
y en el archivo _clsContabilidad.prg escribes algo asi:
DEFINE CLASS Metodos_Contabilidad as Custom
PROCEDURE _Contabiliza
PARAMETERS pCOMPROB, pFECHA, pDETALLE, pORIGEN, pCONTABIL
(.... TU CÓDIGO ...)
ENDPROC
ENDDEFINE
c.x.
>Hola a Todos.
>quien me podria decir como puedo crear objetos de forma dinamica?
>Tengo que crear unos botones y grillas, pero cada boton debe tener un codigo diferente, es decir, uno de ellos hace un borrado, el otro se conecta a Internet y otros.
>
>alguna idea?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only