Dismiss Notice

REGISTRATION IS AFTER ADMIN ACTIVATION

DONATIONS WITH PAYPAL CLICK TO BUTTON

1 MONTH VIP - 5$; 3 MONTHS VIP - 10$; 6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$

DONATIONS WITH Bitcoin Address:3NRs3CK3fhXifrNYxHEZKpETDd9vNLMsMD

Dismiss Notice
The registration is approved by the Administrator. It takes about 1 day to approve your registration
Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

TmgModalWaitDlg - a modal 'Please, wait...' dialog

Discussion in 'Delphi Components' started by AdminDF, Jul 3, 2014.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member DelphiFan Administrator Staff Member DF Staff

    [​IMG]

    TmgModalWaitDlg is a very simple non visual component which creates a modal dialog which doesn't prevent the main form to execute any process it's doing. Usually, if you use ShowModal method, all processes the main form should accomplish stop until you release the modal dialog.

    Usually you have to use Show method instead of ShowModal and then add following lines of code:

    Code:
    
    var
    
    FormPointer: Pointer;
    
    DialogForm: TForm;
    
    begin
    
    if not Assigned(DialogForm) then
    
    DialogForm := TDialogForm.Create;
    
    DialogForm.Parent := Form1;
    
    DialogForm.Show;
    
    FormPointer := DisableTaskWindows(Dialog.Handle)
    
    // Do stuff here...
    
    end;
    

    Then you have to manually create a new form and be sure to add these two events:


    procedure TDialogForm.FormClose(Sender: TObject);

    begin

    Action := csaFree;

    end;



    procedure TDialogForm.FormDestroy(Sender: TObject);

    begin

    TDialogForm := nil;

    end;



    Then, when you have to close the dialog you should add this line:

    Code:
    EnableTaskWindows(FormPointer)
    I turned this code in a component which will allow you to simply write this:

    Code:
    
    begin
    
    mgModalWaitDlg1.Show;
    
    // Do stuff here...
    
    mgModalWaitDlg1.Hide;
    
    end;
    

    Optionally, you can add code to change the Dialog label caption (statically or dinamically, to reflect the progress of the task. I find it easy and quick... and I love what is quick and easy!

    Download HERE

    Download Demo HERE
     
  2. kilmos
    Offline

    kilmos DF Junior

    RE:

    Thanks
     
  3. mato0o
    Offline

    mato0o DF Junior

    Thank you!
     
  4. ewo2006
    Offline

    ewo2006 DF Member

    RE:

    good tutorial thanks
     
  5. MisterZip
    Offline

    MisterZip DF Member

    Nice,
    thanks!
     
  6. dreamersunny
    Offline

    dreamersunny DF Junior

    RE:

    thanks
     
  7. stepyura
    Offline

    stepyura Guest

    RE:

    Thanks
     

Share This Page

Laws
Our website, law, laws, copyright and aims to be respectful of individual rights. Our site, as defined in the law of 5651 serves as a provider of space. According to the law, contrary to the law of site management has no obligation to monitor content. Therefore, our site has adopted the principle of fit and remove. Works are subject to copyright laws and is shared in a manner that violated their legal rights, or professional associations, rights holders who, adsdelphi@gmail.com I can reach us at e-mail address. Complaints considered to be infringing on the examination of the content will be removed from our site.
Donate Help To Us and Be VIP
DONATIONS WITH PAYPAL CLICK TO BUTTON
6 MONTHS VIP - 20$; 1 YEAR VIP - 30$; 2 YEARS VIP - 50$; GOLD USER FOR LIFE VIP - 150$
Social Block