FoxPro/Visual FoxPro - no ejecuta evento click en boton

 
Vista:
sin imagen de perfil

no ejecuta evento click en boton

Publicado por eduardo (139 intervenciones) el 19/07/2007 19:13:08
hola:

tengo este programa en el cual todo me funciona bien,excepto que cuando hago click en el boton salir de la clas eboton que cree ,no me hace el release del form.
necesitaria que por favor me digan el error.gracias.
codigo:

PUBLIC oForm
oForm = NEWOBJECT("MiForm")

oForm.addobject("boton","commandbutton")
oForm.AddObject("grilla","grid")
oForm.boton.left=10
oForm.boton.top=10
oForm.boton.visible=.t.
OFORM.BOTON.CAPTION="SALIR"
oForm.grilla.left=50
oForm.grilla.top=50
oForm.grilla.visible=.t.
oform.grilla.recordsource="clientes"
oform.grilla.recordsourcetype=1
oForm.SHOW
DEFINE CLASS BOTON AS COMMANDBUTTON &&esto es lo que no ejecuta
procedure BOTON.click
RELEASE THISFORM
endproc
ENDDEFINE

DEFINE CLASS MiForm AS FORM
TOP = 0
LEFT = 0
DOCREATE = .T.
CAPTION = "Ejemplo de formulario vacio "
WINDOWSTATE = 0
NAME = "Form1"
WIDTH = 640
HEIGHT = 300
procedure load
set defa to e:\prueba
CLOSE DATA ALL
use clientes in 0
sele clientes
SET ORDE TO CODCLI
go BOTTOM
thisform.refresh
endproc
ENDDEFINE
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:no ejecuta evento click en boton

Publicado por Rafael (12 intervenciones) el 19/07/2007 19:54:16
Creo que el comando lo estas poniendo mal, yo lo pongo asi:

Thisform.release

y nunca me ha dado problema para que funcione el boton.

Suerte.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

gracias,probe el comando pero sigue =

Publicado por eduardo (139 intervenciones) el 19/07/2007 20:16:48
gracias de todas maneras.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:gracias,probe el comando pero sigue =

Publicado por Ernesto Hernandez (4623 intervenciones) el 19/07/2007 21:35:15
pruebalo asi

DEFINE CLASS cmdMyCmdBtn AS CommandButton && Crea EL BOTON DE COMANDO
Caption = '\<Quit' && CAPTION DEL BOTON
Cancel = .T. && Default Cancel
Left = 185 && Command button column
Top = 250 && Command button row
Height = 25 && Command button height

PROCEDURE Click
CLEAR EVENTS && DETIENE EL PROCESO DE EVENTOS
CLOSE ALL && CIERRA LA BASE Y LA TABLA
THISFORM.RELEASE

ENDDEFINE

Suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar
sin imagen de perfil

RE:no ejecuta evento click en boton

Publicado por Ernesto Hernandez (4623 intervenciones) el 19/07/2007 21:34:51
pruebalo asi

DEFINE CLASS cmdMyCmdBtn AS CommandButton && Crea EL BOTON DE COMANDO
Caption = '\<Quit' && CAPTION DEL BOTON
Cancel = .T. && Default Cancel
Left = 185 && Command button column
Top = 250 && Command button row
Height = 25 && Command button height

PROCEDURE Click
CLEAR EVENTS && DETIENE EL PROCESO DE EVENTOS
CLOSE ALL && CIERRA LA BASE Y LA TABLA
THISFORM.RELEASE

ENDDEFINE

Suerte
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar