Reputation:
I don't understand what's wrong with this code:
procedure WebBrowserForm.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked = true then
Button1.Enabled = true else
Button1.Enabled = false;
end;
Could somebody please tell me?
Upvotes: 1
Views: 211
Reputation: 30715
Your code should be
procedure WebBrowserForm.CheckBox1Click(Sender: TObject);
begin
if CheckBox1.Checked = true then
Button1.Enabled := true else
Button1.Enabled := false;
end;
In Delphi, the assignment operator is :=
, while =
is the comparison operator instead.
BTW, you could write your code more simply as
procedure WebBrowserForm.CheckBox1Click(Sender: TObject);
begin
Button1.Enabled := CheckBox1.Checked;
end;
Upvotes: 9