M.Ammar Posted August 27, 2019 Share Posted August 27, 2019 Hi UnimMenu.visable waits until all the code for report generating to finish Before it starts to hide, this give bad user interface, user keep pressing the report Button again and again I tared to use screenmask but it don't affect the menu Only the main form. For Example this code procedure TMainmForm.Action1Execute(Sender: TObject); begin UnimMenu1.Visible := False; sleep(10000); end; why do the UnimMenu starts to hide after the sleep time? What to do to make it hide immediately? Regards Link to comment Share on other sites More sharing options...
Freeman35 Posted August 27, 2019 Share Posted August 27, 2019 follow sleep command in delphi help. Sleep command not JUST (wait / stop) when run, its freeze "Application". So I recomemended use sleep command just native application. For I:=0 To 99 do Application.Progresmessaged; much better, or use gettickcound in loop 1 Link to comment Share on other sites More sharing options...
M.Ammar Posted August 27, 2019 Author Share Posted August 27, 2019 Freeman35 thank you for reply Sleep is used as just an example (Maybe bad example) other code that I use is Query to generates a fastReport it take about 10 seconds to show report and hide the Menu the actual code is procedure TMainmForm.APrintContractExecute(Sender: TObject); begin UnimMenuAction.Visible := False; unimainModule.FDQUserBranchs.Refresh; // refresh query MainDataModule.OpenContractQry(1); // open query MainDataModule.OpenConConditions(); // open query TUnimPDFForm.Create(UniApplication).ShowModal(); end; the point is the I want the expected behaver to hide Menu without waiting until all the code is finshed; thanks again; Link to comment Share on other sites More sharing options...
Recommended Posts