Jump to content

Why "UniForm.Enabled = False" doesn't work


Luciano França

Recommended Posts

  • 5 weeks later...
6 hours ago, Tokay said:

How to temporary disble whole form? Does it possible?

// something like this

procedure TMainForm.UniBitBtn1Click(Sender: TObject);
  procedure DisableControls(Ctl: TControl; AEnabled: Boolean);
  var
    I: Integer;
    WC: TWinControl;
  begin
    if Ctl is TWinControl then
    begin
      WC := TWinControl(Ctl);
      for I := 0 to WC.ControlCount-1 do
        DisableControls(WC.Controls[i], AEnabled);
     end;
    Ctl.Enabled := AEnabled;
  end;
begin
  Self.Enabled := not Self.Enabled;
  DisableControls(Self, Self.Enabled);
  //
end;

 

  • Happy 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...