Top-level forms can not be Modal. If they are setup that way, VFP coerces the WindowType property to 0 (Non-modal) during form instantiation.
Try creating your license form as Top-level and add a Read Events to the IF...ENDIF. This will stop the execution of your program and allow interaction with the license form. Create a form-level property for your license form to hold whether the user clicked on "I Agree". If they do, change the property to .T. and leave it .F. for all other buttons.
Have the buttons call code to set the form's Visible property to .F. and issue a CLEAR EVENTS. Then add code to assign a variable to the form's registerd property and then release the form. If the variable is okay, then run your other top-level form and issue another READ EVENTS.
setup stuff
more setup stuff
local memvar1, olicenseform
memvar1 = .F.
If lnotregistered
do form license name olicenseform linked
read events
memvar1 = olicenseform.lRegsitered
release olicenseform
EndIf
If memvar1
do form toplevel
read events
EndIf
cleanup stuff
Just my $0.02.
>This is a problem that I should know how to fix, but I really would like to hear from the experts on the correct way.
>
>I have a simple program that calls one main form. That form is top level.
>
>Program goes...
>
>setup stuff
>more setup stuff
>do form toplevel
>read events
>cleanup stuff
>
>All works OK, but now I want to add a license agreement form that requires the user to check OK before continuing. So I made a nice top level modal license form with a check box and I put the code...
>
>setup stuff
>more setup stuff
>If lnotregistered
> do form license to memvar1
>EndIf
>If !empty(memvar1)
> do form toplevel
>EndIf
>read events
>cleanup stuff
>
>I have been playing around with the location of the read events, but I get the license form to show and the other form to show after it. BTW, there is a lot of stuff in the init op my top level form that fires this way.
>
>Should I stop the toplevel form from showing (hide it) if lnotregistered.
>Should I make the license form always on top.
>
>Any suggestions on how to handle this license agreement predicament are appreciated.
>
>Thanks,
>
>Ron.
Larry Miller
MCSD
LWMiller3@verizon.netAccumulate learning by study, understand what you learn by questioning. -- Mingjiao