procedure qweClick(Sender: TObject);
var
CheckBox1: TCheckBox;
Edit1: TEdit;
begin
if (Sender is TCheckBox) then
CheckBox1:= TCheckBox(Sender);
Edit1:= TEdit(CheckBox1.Parent.FindComponent('Edit'));
end;
Umm...your not disabling the Edit1 here...
procedure qweClick(Sender: TObject);
var
a_CheckBox1: TCheckBox;
a_Edit1: TEdit;
//I always use a_ for local scope variables...so that their is no ambiguity between variables...
begin
if (Sender is TCheckBox) then
begin
a_CheckBox1:= TCheckBox(Sender);
a_Edit1:= TEdit(a_CheckBox1.Parent.FindComponent('Edit'));
if Assigned(a_Edit1) then
a_Edit1.Enabled := not a_Checkbox1.checked;
end;
end;