Discussion:
Close dialog from program instead of by user input
(too old to reply)
Rene
2008-07-30 19:37:22 UTC
Permalink
Hello,

In my program at some time there can be a MessageDlg and another one on top
of it that is produced by a timer function. When the user presses a button
on that last one, the first one is not necessary anymore. I have searched
the web but could not find a way to close the first one from within my
program. There are many solutions but they are from people that are using
MFC and the solutions don't seem to work when pasted in BCB.

Does anyone know how to do this in BCB?

Again, all input is highly appreciated!

Thanks in advance.

Yours sincerely,
Rene
Remy Lebeau (TeamB)
2008-07-30 20:23:40 UTC
Permalink
Post by Rene
In my program at some time there can be a MessageDlg and another
one on top of it that is produced by a timer function. When the user
presses a button on that last one, the first one is not necessary anymore.
I have searched the web but could not find a way to close the first one
from within my program.
Use your own modal TForm instead of MessageDlg(). That way, you can call
the form's Close() method whenever you want. Or, at the very least, call
CreateMessageDialog() directly (which is what MessageDlg() does
internally( instead of creating your own TForm.


Gambit
Rene
2008-07-31 12:13:47 UTC
Permalink
Post by Remy Lebeau (TeamB)
Post by Rene
In my program at some time there can be a MessageDlg and another
one on top of it that is produced by a timer function. When the user
presses a button on that last one, the first one is not necessary anymore.
I have searched the web but could not find a way to close the first one
from within my program.
Use your own modal TForm instead of MessageDlg(). That way, you can call
the form's Close() method whenever you want. Or, at the very least, call
CreateMessageDialog() directly (which is what MessageDlg() does
internally( instead of creating your own TForm.
Hello Gambit,

Thank You for Your reply!

Yours sincerely,
Rene

Continue reading on narkive:
Loading...