Delphi Non Blocking ShowModal

I was wondering if the show TForm method exists without waiting for it (like TForm.Show). But I would like to BLOCK all other forms (as in ShowModal)

Example:

I have Form1 and Form2. Form1 has a button that should open Form2, but Form1 is blocked, but pressing the button still continues the code that appeared after opening Form2.

procedure TForm1.Button1Click(Sender: TObject); begin Form2.ShowModal; // ===> Something like that but the Code should continue, yet Form1 and all other forms are blocked (disabled) MessageBox (0, 'Code continues', '', 0); end; 

I hope you know what I mean.

+4
source share
1 answer

You can call DisableTaskwindows, except that your window is disabled, and later EnableTaskWindows to enable other forms again.

  Form3.Show; FP:=DisableTaskwindows(Form3.Handle); //Some Code EnableTaskwindows(FP); 
+9
source

All Articles