View Full Version : events on application open/close


YevS
11-12-2007, 12:05 AM
Hi,

I'm trying to write in some events that I want to start on application open and close. So far I have not been able to find those event handlers.

Open is pretty easy, just need to stick it on the first form that opens, but close is a bit tricky. There is no way to be 100% sure that any 1 form would remain open for the duration of the work and I havent found a dedicated event handle for it.

me.visible property does not seem to work for me in forms either (when trying to create an invisible form to handle these events.)

What I'm trying to do is create a table on startup and drop it when the application closes. I can probably do this via an array, but I'm trying to avoid that.

Any ideas?

OlcayM
11-12-2007, 01:54 AM
Hi,

1)Open a hidden form on the start of application.
2) Forms load event put anything you wish
3) Forms close event put anything you wish

Since the form is hidden, it will not be closed accidantely. And during the applications close it will run his close event.

HTH
OlcayM

YevS
11-12-2007, 02:30 AM
1)Open a hidden form on the start of application.

Thats my problem. I dont know how to do that.

visible = false doesent seem to work

OlcayM
11-12-2007, 03:19 AM
1) Create a form with a name "frmHidden"
2) Forms load event put anything you wish
3) Forms close event put anything you wish
4) Save & close form
5) Create a macro with the name "autoexec"
6) Use openform command in the macro for frmHidden
7) Set Window mode option "Hidden"
8) Save macro and close

Since, whenever you start your application, a macro with a name "autoexec" will automatically runs, your form will be open and does whatever you wish

HTH
OlcayM

OlcayM
11-12-2007, 03:21 AM
1) Create a form with a name "frmHidden"
2) Forms load event put anything you wish
3) Forms close event put anything you wish
4) Save & close form
5) Create a macro with the name "autoexec"
6) Use openform command in the macro for frmHidden
7) Set Window mode option "Hidden"
8) Save macro and close

Since, whenever you start your application, a macro with a name "autoexec" will automatically runs, your form will be open and does whatever you wish

HTH
OlcayM

YevS
11-12-2007, 03:27 AM
thanks, that did the trick