一段程序运行时间比较长,希望用户在运行的时候等待结果的输出而不要乱点按钮之类的。如何做?实际的情况是不希望反复的点击TTreeView转移选择的节点。

解决方案 »

  1.   

    TForm.KeyPreview设为Trueprocedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
    begin
      Key := #0;
    end;
      

  2.   

    function BlockInput (fBlockInput : boolean) : DWord; stdcall; external 'user32.DLL';procedure ...
      BlockInput(true);
      ...
      BlockInput(false);