When I create modal dialogs I almost always use Create(nil). Have you tried that?
Here's an article on the subject I came across a while back:
TForm.Create(AOwner)
Picking the right parameter to optimize memory usage
Thanks Mark,
Yes, using nil (as per your suggestion and the article you referenced) solves the problem.
I think I may have been aware of that at some stage in the past, but had obviously forgotten about it, so much appreciate your response.
David
Yes, using nil (as per your suggestion and the article you referenced) solves the problem.
I think I may have been aware of that at some stage in the past, but had obviously forgotten about it, so much appreciate your response.
David
David Henderson
... actually, using nil in the create hasn't fixed it. Immediately after changing it to nil I tested and it was working as expected (on closing the file dialog DataCAD was the top window), but this morning it is consistently not working. I haven't changed anything since yesterday (still using nil in the create), so am at a bit of a loss to explain.
The problem is only occurring with TOpenDialog (there are a couple other forms that are created, displayed modally and then freed by the macro and the same problem does not exist with these). I can live with the issue and will put back the code that restores DataCAD to the top window unless anybody has a better suggestion ....
The problem is only occurring with TOpenDialog (there are a couple other forms that are created, displayed modally and then freed by the macro and the same problem does not exist with these). I can live with the issue and will put back the code that restores DataCAD to the top window unless anybody has a better suggestion ....
David Henderson
Who is online
Users browsing this forum: No registered users and 42 guests