Wiki Home

Read Events : Run - time Formfailstostayup


Namespace: WIN_COM_API
Hi,
I am trying to add a run-time form to an exisiting VFP 7 application where the READ EVENTS is executed higher up in the program.
My problem is my form does not pause execution and allow for user input. The form appears, with the grid fully populated for a moment and then clears and my program ends.

Here is my code:

SELECT users, id FROM users.dbf ORDER BY 1 INTO CURSOR ac_users
=l_doform()
ENDIF
RETURN

******************************************
FUNCTION l_doform

GO TOP
lof = CREATEOBJECT("UserList")
lof.visible = .t.
lof.show()

DEFINE CLASS UserList as Form

PROCEDURE init()
WITH THIS
.Caption = "User List"

.ADDOBJECT('cmdCancel', 'cCancel' )
.cmdCancel.VISIBLE = .T.

.ADDOBJECT("grid1","grid")
.grid1.visible = .t.
.grid1.readonly = .t.
ENDWITH
ENDPROC

ENDDEFINE

DEFINE CLASS cCancel AS COMMANDBUTTON
CANCEL = .T.
CAPTION = "Exit"
HEIGHT = 25

PROCEDURE init()
this.TOP = thisform.HEIGHT - this.HEIGHT - 5
this.LEFT = thisform.WIDTH - this.WIDTH - 5
ENDPROC

PROCEDURE CLICK
THISFORM.RELEASE()
ENDPROC
ENDDEFINE

******************************************
*END FUNCTION l_doform
******************************************
( Topic last updated: 2011.04.05 02:19:10 PM )