Board index » delphi » Form.Show -- is it possible to disable the main form until I close the second one?

Form.Show -- is it possible to disable the main form until I close the second one?

Dear sirs,

In VB, there is a command like this:
Form4.Show 1

which means I can't work with the main form before I hide the form4. Is
such a thing possible with Delphi? Can anybody advice how to do that?

Thank you in advance,

L.Arc.

 

Re:Form.Show -- is it possible to disable the main form until I close the second one?


Quote
Leonid A.Arcadiev wrote:
> Dear sirs,

> In VB, there is a command like this:
> Form4.Show 1

> which means I can't work with the main form before I hide the form4. Is
> such a thing possible with Delphi? Can anybody advice how to do that?

> Thank you in advance,

> L.Arc.

  Yes, with Form4.ShowModal

Re:Form.Show -- is it possible to disable the main form until I close the second one?


Quote
Leonid A.Arcadiev wrote:
> Dear sirs,

> In VB, there is a command like this:
> Form4.Show 1

> which means I can't work with the main form before I hide the form4. Is
> such a thing possible with Delphi? Can anybody advice how to do that?

> Thank you in advance,

> L.Arc.

  Yes, with Form4.ShowModal

Re:Form.Show -- is it possible to disable the main form until I close the second one?


In article <01bde017$d68dd190$c2824018@dundas>, "Leonid A.Arcadiev"

Quote
<arcad...@usa.net> writes:
>In VB,

Wash your mouth out, this instance !! <g>

Quote
> there is a command like this:
>Form4.Show 1

>which means I can't work with the main form before I hide the form4. Is
>such a thing possible with Delphi? Can anybody advice how to do that?

Form4.ShowModal;

Form4 then shows until a global variable named ModalResult is set to a non-null
value. Values available are :-

mrNone  (0)
mrOk    
mrCancel
mrAbort
mrRetry
mrIgnore
mrYes
mrNo
mrAll  

Some of the other values can be set by the buttons (SpeedButton or BitButton)
and can be chosen for the button in the Object Inspector. You can also set them
in code.

Once they are set and the form closed you can check the value to find out
whether the form was closed with an OK (mrOK), Yes (mrYes) or Cancel(mrCancel)
button, and so take appropriate actions.

Alan Lloyd
alangll...@aol.com

Re:Form.Show -- is it possible to disable the main form until I close the second one?


Try Form4.ShowModal;

Leonid A.Arcadiev <arcad...@usa.net> wrote in article
<01bde017$d68dd190$c2824018@dundas>...

Quote
> Dear sirs,

> In VB, there is a command like this:
> Form4.Show 1

> which means I can't work with the main form before I hide the form4. Is
> such a thing possible with Delphi? Can anybody advice how to do that?

> Thank you in advance,

> L.Arc.

Re:Form.Show -- is it possible to disable the main form until I close the second one?


Hi
I think what you are referring to is the ShowModal function.  eg
Form4.ShowModal;

Lief

Quote
Alexandre Danault wrote:
> Try Form4.ShowModal;

> Leonid A.Arcadiev <arcad...@usa.net> wrote in article
> <01bde017$d68dd190$c2824018@dundas>...
> > Dear sirs,

> > In VB, there is a command like this:
> > Form4.Show 1

> > which means I can't work with the main form before I hide the form4. Is
> > such a thing possible with Delphi? Can anybody advice how to do that?

> > Thank you in advance,

> > L.Arc.

Other Threads