• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 440
  • Last Modified:

Form always show/use, even after a showmodal

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?
0
Mat_a
Asked:
Mat_a
1 Solution
 
j42Commented:
Hi,

maybe you can try an MDI application?

Regards
0
 
geobulCommented:
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
0
 
steve_hskCommented:
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,
Steve
0
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.

 
Mat_aAuthor Commented:
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.?
0
 
Slick812Commented:
???????
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?
0
 
Mat_aAuthor Commented:
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.
0
 
mocartsCommented:
type
  TForm1 = class(TForm)
  ...
  private
    procedure WMEnable(var message: TWMEnable); message WM_ENABLE;
  ...
  end;

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


wbr, mo.
0
 
Mat_aAuthor Commented:
Fantastic - exactly the kind of hack I hoped for!!
0
 
geobulCommented:
Nice mo, very nice. And useful. I'll remember that ;-)
0

Featured Post

Learn to develop an Android App

Want to increase your earning potential in 2018? Pad your resume with app building experience. Learn how with this hands-on course.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now