I'm using the following code to make CheckBox visible.
CheckBox: Array[1..15] of TcheckBox;
procedure TForm1.edt_variavelChange(Sender: TObject);
var valor,x,i : integer;
if valor = 2 then
begin
for i := 1 to 2 do
begin
TEdit(FindComponent('edt_variavel'+IntToStr(i))).Visible := true
CheckBox[i].Visible := true;
end;
But it gives a Acess Violation
, when using the debug and give a BREAK
in the error I am directed to this code of Vcl.Controls
procedure TControl.SetVisible(Value: Boolean);
begin
if FVisible <> Value then
begin
VisibleChanging;
FVisible := Value;
Perform(CM_VISIBLECHANGED, Ord(Value), 0);
RequestAlign;
end;
end;
How can I fix this error?