[Gambas-user] How to exit loop and close the form
Benoît Minisini
gambas at ...1...
Mon Nov 22 12:45:23 CET 2010
> Thank for your answers, but the result is the same.
>
> I let the progress run to the end but it does not automatically close.
>
> I tried some ways:
> I change "Me.Close" by:
> "Me.Hide" => same result, the dialog still appears
> "ProgressBar2.Visible = False" => ProgressBar2 disappears
> "Quit" => when I click Cancel button or let it finish, program quits
> normally.
>
> May be I have to change my design ... ~.~ (I think about use a container
> control like panel or frame on FMain + Visible attribute).
>
Because you are doing that during the Form_Open event. If I remember,
depending on the Gambas version you use, closing the form during that event
may have no effect.
Anyway, don't process anything during a "Open" event. Do that later. For
example, during the Form_Activate event handler, with a flag to ensure that
you start your process once.
But the real working solution is not using a modal dialog, and disable all the
GUI during the processing, except the "Cancel" button.
Regards,
--
Benoît Minisini
More information about the User
mailing list