How can I enable/disable all controls of the form ?
I did a procedure, but does not work:
Code:
procedure Status(sForm: Tform; bHab: boolean);
var
x : integer;
nome: String;
begin
for x := 0 to sForm.ControlCount – 1 do
if (sForm.Controls[x] is TsButton) then
begin
sForm.Controls[x].Enabled := bHab;
end;
end;
procedure Status(sForm: Tform; bHab: boolean);
var
iA : integer;
AComponent: TComponent;
begin
for iA := 0 to sForm.ComponentCount – 1 do
begin
if sForm.Components[iA] is TsButton then
begin
AComponent := sForm.FindComponent(sForm.Components[iA].Name);
if Assigned(AComponent) then
if AComponent is TControl then
TControl(AComponent).Enabled := bHab;
end;
end;
end;