Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 142
  • Last Modified:

MDI Style application (Simulating Modal form by process)

This is what I want to do.

I have an MDI Style app, The processes are 'Orders', 'Customers'. these are two mdi child forms that have a details of orders, customers.  Each one have Add, Modify

What I want is If yo click Add in orders, display the Add orders Child form on top of Orders form i dont permits to focus the order form until the add work is done. But it permits to open the Customer form without problems. ('The same for customers')
0
jose_suero
Asked:
jose_suero
  • 2
1 Solution
 
mocartsCommented:
// in list form of Orders (and Customers)
TfrmOrders.btnAddDetailsClick(Sender: TObject);
begin
  // passing to constructor Owner i.e. frmOrders
  with TfrmOrderDetails.Create(Self) do
    Show;
end;

// in details form
TfrmOrderDetails.FormShow(Sender: TObject);
begin
  // taking forms owner (in orders case this will be Order
  // list form, as we passed it as owner) and disabling it
  EnableWindow(TForm(Owner).Handle, False);
end;

TfrmOrderDetails.FormClose(Sender: TObject);
begin
  // back to enabled state
  EnableWindow(TForm(Owner).Handle, True);
end;

wbr, mo.
0
 
jose_sueroAuthor Commented:
Thanks, I did almost the same with different code.  But your code it's more interesting.

Thanks again.
0
 
mocartsCommented:
you are welcome :)
mo.
0
 
CleanupPingCommented:
jose_suero:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

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