Hi,

I'm running VFP 9.0 sp1 and I want to fire an event after the main form of
the application is displayed. I want a messagebox to appear when the
application starts that prompts the user to say yes or no. I tried putting
it into the Init() event of the form but the messagebox pops up before the
form is displayed. I've thought about putting it into the Activate() event
but then it fires every time I select the form also, I only want it to fire
when the program launches. Any suggestions?

Thanks in advance,
Linn

Re: Fire event after form is displayed? by Gregory

Gregory
Tue Jan 16 08:08:01 CST 2007

Linn,

(1) in the form init()
this.visible = TRUE
&& maybe doevents
=messagebox()

(2) Form load
=this.AddProperty('FirstTimeActivate', TRUE)

form activate
if( this.FirstTimeActivate)
this.FirstTimeActivate = FALSE
= massagebox(///)
endif

Gregory
_________
"Linn Kubler" <lkubler@chartwellwisc2.com> wrote in message
news:%23PhzBZXOHHA.4644@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I'm running VFP 9.0 sp1 and I want to fire an event after the main form of
> the application is displayed. I want a messagebox to appear when the
> application starts that prompts the user to say yes or no. I tried
> putting it into the Init() event of the form but the messagebox pops up
> before the form is displayed. I've thought about putting it into the
> Activate() event but then it fires every time I select the form also, I
> only want it to fire when the program launches. Any suggestions?
>
> Thanks in advance,
> Linn
>
>


Re: Fire event after form is displayed? by Olaf

Olaf
Tue Jan 16 08:05:51 CST 2007

There is no event between init and activate that runs once like init and has
the form visible already, so you have to do this little trick:

Add a property lPopupdone with Value .F. in your main form.
In the Form.Activate do

If !Thisform.lPopupdone
Thisform.lPopupdone=.T.
Messagebox...
Endif

Bye, Olaf.



Re: Fire event after form is displayed? by Linn

Linn
Tue Jan 16 14:48:26 CST 2007

Thanks for the suggestions guys. Makes sense and I don't see any other way
around it.
Thanks!
Linn
"Linn Kubler" <lkubler@chartwellwisc2.com> wrote in message
news:%23PhzBZXOHHA.4644@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I'm running VFP 9.0 sp1 and I want to fire an event after the main form of
> the application is displayed. I want a messagebox to appear when the
> application starts that prompts the user to say yes or no. I tried
> putting it into the Init() event of the form but the messagebox pops up
> before the form is displayed. I've thought about putting it into the
> Activate() event but then it fires every time I select the form also, I
> only want it to fire when the program launches. Any suggestions?
>
> Thanks in advance,
> Linn
>
>