procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
0Abegin
  if button1.enabled then CanClose := true
  else CanClose := false; //如果不可用就不能退出
end;—————————————————————————————————
MaximStr := '宠辱不惊,看庭前花开花落,去留无意;
             毁誉由人,望天上云卷云舒,聚散任风。';
if Not Assigned(I) then
  I := TI.Create(Nil);
I.Maxim := MaximStr;
—————————————————————————————————
       

解决方案 »

  1.   

    procedure TSchoolCodeManageForm.FormCloseQuery(Sender: TObject;
      var CanClose: Boolean);
    begin
    if button1.enabled then
       CanClose:=true;
    else
      CanClose:=false;
      

  2.   

    procedure TForm1.FormCloseQuery(Sender: TObject; var CanClose: Boolean);
    begin
      CanClose := button1.enabled ; //如果不可用就不能退出
    end;
      

  3.   

    if button1.enabled=true then
    begin
    end和
    if button1.enabled then
    begin
    end
    为什么 不行?》
      

  4.   

    if button1.enabled=true then
    begin
    end和
    if button1.enabled then
    begin
    end
    为什么 不行?》
    因为True是什么呀?逻辑变量不能这样用!真和假是比较的结果!