| View previous topic :: View next topic |
| Author |
Message |
chris ross Guest
|
Posted: Fri Oct 03, 2003 10:07 am Post subject: Non-Modal Form |
|
|
Can you tell me how to create a non-modal form in an application. I can
get other programs to run e.g. calculator in a shell but cann't seem to
find the necessary Show command.
Thanks
|
|
| Back to top |
|
 |
chris ross Guest
|
Posted: Fri Oct 03, 2003 11:47 am Post subject: Re: Non-Modal Form |
|
|
Using just the show the form flashes on and closes stright away.
I want the form on screen so users can refer to the information while
switches in the main application to other screens.
George Christoforakis wrote:
| Quote: | Form1.Show will open the form in a non-modal way.
The FormStyle should not be fsStayOnTop.
Do you mean by using the ShellExecute?
George Christoforakis
"chris ross" <chris (AT) tenerifeinsurance (DOT) biz> wrote in message
news:3F7D4A46.9060408 (AT) tenerifeinsurance (DOT) biz...
Can you tell me how to create a non-modal form in an application. I can
get other programs to run e.g. calculator in a shell but cann't seem to
find the necessary Show command.
Thanks
|
|
|
| Back to top |
|
 |
George Christoforakis Guest
|
Posted: Fri Oct 03, 2003 12:25 pm Post subject: Re: Non-Modal Form |
|
|
Form1.Show will open the form in a non-modal way.
The FormStyle should not be fsStayOnTop.
Do you mean by using the ShellExecute?
George Christoforakis
"chris ross" <chris (AT) tenerifeinsurance (DOT) biz> wrote
| Quote: | Can you tell me how to create a non-modal form in an application. I can
get other programs to run e.g. calculator in a shell but cann't seem to
find the necessary Show command.
Thanks
|
|
|
| Back to top |
|
 |
George Christoforakis Guest
|
Posted: Fri Oct 03, 2003 1:44 pm Post subject: Re: Non-Modal Form |
|
|
You can leave the form open (don't close it, or disable the close/minimise
buttons) and put it somewhere else on the screen or use an MDI application.
George Christoforakis.
"chris ross" <chris (AT) tenerifeinsurance (DOT) biz> wrote
| Quote: | Using just the show the form flashes on and closes stright away.
I want the form on screen so users can refer to the information while
switches in the main application to other screens.
|
|
|
| Back to top |
|
 |
Wayne Niddery [TeamB] Guest
|
Posted: Fri Oct 03, 2003 2:27 pm Post subject: Re: Non-Modal Form |
|
|
chris ross wrote:
| Quote: | Using just the show the form flashes on and closes stright away.
|
Is it closing or just getting hidden behind other forms?
If you are calling Show then it will not close on its own unless you are
doing something to close it (like calling Free after calling Show?).
If you want it to stay visible while user uses other forms then set the
StayOnTop style in the form properties.
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: http://www.logicfundamentals.com/RADBooks.html
"It is error alone which needs the support of government. Truth can
stand by itself." - Thomas Jefferson
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Fri Oct 03, 2003 2:34 pm Post subject: Re: Non-Modal Form |
|
|
If the form closes immediately something in your code is closing it.
Set a breakpoint on the Show call and step through your code.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
| Back to top |
|
 |
chris ross Guest
|
Posted: Mon Oct 06, 2003 3:25 pm Post subject: Re: Non-Modal Form |
|
|
I am freeing it, but this is standard code to free the resources and
should only be executed once the user closes the form.
I'll recheck the code and try the StayOnTop style.
Ta
Wayne Niddery [TeamB] wrote:
| Quote: | chris ross wrote:
Using just the show the form flashes on and closes stright away.
Is it closing or just getting hidden behind other forms?
If you are calling Show then it will not close on its own unless you are
doing something to close it (like calling Free after calling Show?).
If you want it to stay visible while user uses other forms then set the
StayOnTop style in the form properties.
|
|
|
| Back to top |
|
 |
chris ross Guest
|
Posted: Thu Oct 09, 2003 1:55 pm Post subject: Re: Non-Modal Form |
|
|
Hi Bill,
I have stepped through the code and I am only getting to show and then
there is the Finally... in which I free the resources. This should
only be activated by the User closing the form, correct?
So it shows, then I press F7 in debug mode to move on a line and it
steps into the finally clause. I have not clicked on anything iin the
form to request a closure.
Any ideas?
Bill Todd wrote:
| Quote: | If the form closes immediately something in your code is closing it.
Set a breakpoint on the Show call and step through your code.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Thu Oct 09, 2003 4:38 pm Post subject: Re: Non-Modal Form |
|
|
On Thu, 09 Oct 2003 15:55:16 +0200, chris ross
<chris (AT) tenerifeinsurance (DOT) biz> wrote:
| Quote: | This should
only be activated by the User closing the form, correct?
|
No. That is not correct. When you call Show the form is non-modal and
your code continues to execute. When you call ShowModal execution
stops on the call to ShowModal until the user closes the form.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
| Back to top |
|
 |
chris ross Guest
|
Posted: Fri Oct 10, 2003 5:39 pm Post subject: Re: Non-Modal Form |
|
|
Okay.., so in that case I am probably looking at this issue the wrong way.
My Insurance Database application uses modal forms throughout, however,
what I wanted to create was a utility or other form that could stay open
while the main application is running so that the Users could refer to
the information on it. I thought I could do this by showing a form but
in a non-modal state so it would be independant to the main processing
of the application. Am I of course here? How can I acheive the desired
results?
Bill Todd wrote:
| Quote: | On Thu, 09 Oct 2003 15:55:16 +0200, chris ross
[email]chris (AT) tenerifeinsurance (DOT) biz[/email]> wrote:
This should
only be activated by the User closing the form, correct?
No. That is not correct. When you call Show the form is non-modal and
your code continues to execute. When you call ShowModal execution
stops on the call to ShowModal until the user closes the form.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
|
| Back to top |
|
 |
Bill Todd Guest
|
Posted: Fri Oct 10, 2003 7:34 pm Post subject: Re: Non-Modal Form |
|
|
On Fri, 10 Oct 2003 19:39:03 +0200, chris ross
<chris (AT) tenerifeinsurance (DOT) biz> wrote:
| Quote: | I thought I could do this by showing a form but
in a non-modal state so it would be independant to the main processing
of the application. Am I of course here?
|
No. You are on course. That is exactly the way calling Show works.
Consider the following code.
F := TModelessForm.Create(Application);
F.Show;
ShowMessage('The modeless form has been shown');
This will create and show an instance of TModelessForm modelessly and
immidiately show a dialog box with the message in it.
--
Bill (TeamB)
(TeamB cannot respond to questions received via email)
|
|
| Back to top |
|
 |
|