Board index » delphi » I am confused (forms)

I am confused (forms)

I am writing a D3 app with two forms.
The first form doing some basic operation and runs fine.
I add another button to call up form2 when needed.

Now I am a bit confused with how I call it up.
If I do   FORM2.SHOW, form 1 will still on screen and user can still
click back to form1, which could mess up, and is not I want.  If I do
FORM2.SHOWMODAL, users must close the form2 before going back, but
it's kind of stupid as you can't minimised it.

What's the proper way??

Thanks

Now I do as:
     Form1.Hide;
     Form2.Show;
     Repeat  
         Application.ProcessMessages;
     Until not Form2.Visible;
     Form1.Show;

 

Re:I am confused (forms)


Quote
On Thu, 13 Aug 1998 06:37:40 GMT, and...@aelhk.com (Anders Lee) wrote:
>I am writing a D3 app with two forms.
>The first form doing some basic operation and runs fine.
>I add another button to call up form2 when needed.

>Now I am a bit confused with how I call it up.
>If I do   FORM2.SHOW, form 1 will still on screen and user can still
>click back to form1, which could mess up, and is not I want.  If I do
>FORM2.SHOWMODAL, users must close the form2 before going back, but
>it's kind of stupid as you can't minimised it.

>What's the proper way??

>Thanks

>Now I do as:
>     Form1.Hide;
>     Form2.Show;
>     Repeat  
>         Application.ProcessMessages;
>     Until not Form2.Visible;
>     Form1.Show;

It all depends on the type of operations you want the user to do in
form2. If the form is actually some type of dialog box, that should be
completed before returning to form1, use ShowModal. You can still
minimize the form, but more or less of course, since it is a modal
form, form1 won't reappear.

If it is important that they would be able to return to form1 while
using form2, you should use Show. This can indeed be confusing to the
user, so maybe you could use a fsStayOnTop formstyle for form2, so it
would not disappear behind form1. However, ime, this kind of situation
almost always IS confusing to most users. Maybe some redesign of the
program would help here.

Finally, the way you do it can be fine too. As I said, it all depends
on what you want to do. So maybe you want to think a bit about that
too.

Sometimes a cleaner thought on what you're trying to achieve solves
this kind of problem.

hth,

David

------------------
David A. Schweizer

iec ProGAMMA, The Netherlands
d.a.schweizer[OK, i don't want any more spam]gamma.rug.nl
guess where the '@' goes ?

Other Threads