Página 1 de 1
Problem with ShowModal
Publicado: Mié Abr 11, 2007 1:28 pm
por Oleg
Dear developers!
In attached sample I try to call modal form with TDBFBrowse from another
modal form.
When I create this form just before ShowModal, it works.
But when I create this form earlier (in FormInitialize) and use it later,
this form is appeared but does not respond any key or mouse clicks.
I want to use this technique (early form creation) in my projects.
Can you look at this problem?
Thank you. Oleg.
Attached files test14.zip (4.7 KB)Â
Problem with ShowModal
Publicado: Mié Abr 11, 2007 1:58 pm
por jfgimenez
Oleg,
> In attached sample I try to call modal form with TDBFBrowse from another
> modal form.
> When I create this form just before ShowModal, it works.
> But when I create this form earlier (in FormInitialize) and use it later,
> this form is appeared but does not respond any key or mouse clicks.
>
> I want to use this technique (early form creation) in my projects.
>
> Can you look at this problem?
The problem is that TForm3 is created in the TForm2's OnInitialize event. At
this moment, TForm2 is not yet shown, and later, when TForm2:ShowModal() is
called, all other forms are disabled, including TForm3. The way to do that,
is to create TForm3 in the TForm2's OnShow event, when TForm2 is already
shown.
BTW, creating forms at start to use them later requires to set lHideOnClose
to .T., to avoid destroing them prematurely.
Attached is the sampled already fixed.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Attached files test14.zip (3.3 KB)Â
Problem with ShowModal
Publicado: Mié Abr 11, 2007 1:58 pm
por jfgimenez
Oleg,
> In attached sample I try to call modal form with TDBFBrowse from another
> modal form.
> When I create this form just before ShowModal, it works.
> But when I create this form earlier (in FormInitialize) and use it later,
> this form is appeared but does not respond any key or mouse clicks.
>
> I want to use this technique (early form creation) in my projects.
>
> Can you look at this problem?
The problem is that TForm3 is created in the TForm2's OnInitialize event. At
this moment, TForm2 is not yet shown, and later, when TForm2:ShowModal() is
called, all other forms are disabled, including TForm3. The way to do that,
is to create TForm3 in the TForm2's OnShow event, when TForm2 is already
shown.
BTW, creating forms at start to use them later requires to set lHideOnClose
to .T., to avoid destroing them prematurely.
Attached is the sampled already fixed.
--
Regards,
Jose F. Gimenez
http://www.xailer.com
http://www.xailer.info
Attached files test14.zip (3.3 KB)Â
Problem with ShowModal
Publicado: Mié Abr 11, 2007 2:13 pm
por Oleg
Jose!
> The problem is that TForm3 is created in the TForm2's OnInitialize event.
> At this moment, TForm2 is not yet shown, and later, when
> TForm2:ShowModal() is called, all other forms are disabled, including
> TForm3. The way to do that, is to create TForm3 in the TForm2's OnShow
> event, when TForm2 is already shown.
Thank you for the clue and for such fast answer.
BTW I found that I can create form in OnInitialize event if
I write ::oFrm:lEnabled:=.t. just before ::oFrm:ShowModal()
Thank you. Oleg.
Problem with ShowModal
Publicado: Mié Abr 11, 2007 2:13 pm
por Oleg
Jose!
> The problem is that TForm3 is created in the TForm2's OnInitialize event.
> At this moment, TForm2 is not yet shown, and later, when
> TForm2:ShowModal() is called, all other forms are disabled, including
> TForm3. The way to do that, is to create TForm3 in the TForm2's OnShow
> event, when TForm2 is already shown.
Thank you for the clue and for such fast answer.
BTW I found that I can create form in OnInitialize event if
I write ::oFrm:lEnabled:=.t. just before ::oFrm:ShowModal()
Thank you. Oleg.