Rick, I tried using BINDEVENTS() to the _screen.Closable property and it works while the program is initializing (the 'X' button stays enabled, when before it did not). However, once I switch to another app and then back, the screen 'X' becomes disabled. It seems like maybe VFP overrides any programming. I am not sure why though, as I said the only thing that is happening at that point is the timer event running. Also, the only way I could get it to work at all, is to set the nFlag parameter to 3 (in BindEvents). Here is the simple code I wrote:
Code:
PUBLIC oNoClose
oNoClose = NEWOBJECT("sNoClose")
BINDEVENT(_SCREEN, "Closable", oNoClose, 'NoClose_proc', 3)
*** DO FORM HERE ***
DEFINE CLASS sNoClose AS Session
PROCEDURE NoClose_proc
_screen.Closable = .t.
RETURN
ENDDEFINE
Since you are the only other person on this board this seems to have happened to, I was hoping you might have a solution!
Mike, yes, I am referring to the screen close button. The reason for this is a customer demand. There are no controls on the form, the only way to quit is ESC or the close button. This is a conversion from an old DOS program that monitors the modem port and a receive file directory for activity or new files. The customer does not want it to change!
Craig, the code you provided would not duplicate this situation, because the close button is on the screen, not the form. But I think you are right, it is not related to the timer control at all.
Thank you all for your feedback.
Sebastian