Board index » delphi » TCheckBox pet-peeve

TCheckBox pet-peeve

Why is the OnClick event method called whenever a TCheckBox's Checked
property is set in code?  How is setting a property the same as a click??
Perhaps there should be an OnChange event to handle this scenario.

Thanks for letting me rant.  :)

Steve

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

 

Re:TCheckBox pet-peeve


Steve:

You can subvert that with the following technique.

CheckBox1.OnClick := nil;
CheckBox1.Checked := not CheckBox1.Checked;
CheckBox1.OnClick := CheckBox1Click;

--
Regards
Ralph (TeamB)
Herrsching, Germany

Quote
MAGRUDES%charlo...@moodys.com wrote in message

<6ndjin$9j...@nnrp1.dejanews.com>...
|Why is the OnClick event method called whenever a TCheckBox's Checked
|property is set in code?  How is setting a property the same as a click??
|Perhaps there should be an OnChange event to handle this scenario.

Re:TCheckBox pet-peeve


Thanks Ralph for the technique.  It had slipped my mind that events can be
assigned just like properties.  Whoops.  :)

In article <6ne0pm$5n...@forums.borland.com>,
  "Ralph Friedman (TeamB)" <rfriedman@spammenot_ibm.spammenot_net> wrote:

Quote

> Steve:

> You can subvert that with the following technique.

> CheckBox1.OnClick := nil;
> CheckBox1.Checked := not CheckBox1.Checked;
> CheckBox1.OnClick := CheckBox1Click;

> --
> Regards
> Ralph (TeamB)
> Herrsching, Germany

> MAGRUDES%charlo...@moodys.com wrote in message
> <6ndjin$9j...@nnrp1.dejanews.com>...
> |Why is the OnClick event method called whenever a TCheckBox's Checked
> |property is set in code?  How is setting a property the same as a click??
> |Perhaps there should be an OnChange event to handle this scenario.

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/rg_mkgrp.xp   Create Your Own Free Member Forum

Other Threads