Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


Form always show/use, even after a showmodal

Posted on 2003-03-14
Medium Priority
Last Modified: 2010-04-04
I have an application that has a "desktop form" that is always shown. However when I go into some of the applications other screens I have to use showmodal. This in turn renders the "desktop form" useless as you can't move it or anything. Looking through the source for ShowModal it disables all the windows (including my "desktop form").... Is there a way I can get this form to still work correctly?
Question by:Mat_a
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8135755

maybe you can try an MDI application?

LVL 17

Expert Comment

ID: 8135824
Don't use ShowModal for any other form. That's the purpose of ShowModal - to disable all other forms in the current app.

Regards, Geo

Expert Comment

ID: 8135948
Hi Mat ...

As Geo suggested, it's ShowModel's purpose to freeze all other forms whilst the current form is being displayed.

Using Show instead, or just changing the visible = true parameter, will mean that all other forms, including the 'desktop' form can be in focus and selected / moved by the user.

Otherwise, if you want certain form's to be enabled and others not, you simply need to write some simple logic for enabling / showing / hiding forms at certain times.

Hope this helps,
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!


Author Comment

ID: 8136017
Thanks for the input so far, I've been developingin Delphi since version 1... so I am aware of the ShowModal usage, however I probably put my original question in badly as I was trying to find if there was a hack, or another method to do this. Run the form as another process (can I do that) or would it help in it's own thread etc.?
LVL 34

Expert Comment

ID: 8137937
hello Mat A. . . . I could use some more information about why you "I have to use showmodal" and what you "Need" to be Modal (not functioning) and what you need to be non-modal (the desktop form I guess), maybe some info about what you are trying to do with the "new" modal form? It seems you want all other of your app's forms disabled except the desctop form and the pop-up "new" form?

Author Comment

ID: 8138158
Although the project is quite small (only 15 forms) the whole app is quite intertwined, and also has plugins that can access some of the forms as well (using show modal again). Perhaps I am asking the impossible and will leave it, but I was hoping that there might be a way to Ignore a form or a hack to re-enable a form once a show modal has happened (much like freeing and then re-creating/showing the form after ths show modal, which works but is messy based on the number of calls to the show form)... But yes there is one floating desktop form that I want *always* floating (and able to move) even if a show modal has happened.

Accepted Solution

mocarts earned 500 total points
ID: 8139652
  TForm1 = class(TForm)
    procedure WMEnable(var message: TWMEnable); message WM_ENABLE;

procedure TForm1.WMEnable(var message: TWMEnable);
  if not message.Enabled then
    EnableWindow(handle, True);

wbr, mo.

Author Comment

ID: 8139835
Fantastic - exactly the kind of hack I hoped for!!
LVL 17

Expert Comment

ID: 8142190
Nice mo, very nice. And useful. I'll remember that ;-)

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : All lightning effects with instructions : http://www.mediaf…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question